home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / qb4bas45.zip / QB4BAS.DOC < prev    next >
Text File  |  1989-09-30  |  181KB  |  7,525 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.      QB4BAS.LIB -- Version 4.5
  23.  
  24.      October 10, 1989
  25.  
  26.      Harold Thomson
  27.  
  28.      7437 Burnway Drive
  29.      Orlando, Fl.  32819
  30.      407-351-3737
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      PREFACE
  71.  
  72.  
  73.  
  74.  
  75.  
  76.      There has been a major enhancement to this release of QB4BAS.LIB. Many
  77.      of the  routines that required  pre-allocated  strings to be passed in
  78.      the call no  longer require this and will now return their output as a
  79.      string.  Many of the  subroutines have been converted to  functions to
  80.      accomodate this new functionality. This is another step towards making
  81.      these routines appear as if they are a part of QuickBASIC.
  82.  
  83.  
  84.      QB4BAS.LIB is  a  collection  of subroutines and  functions which  are
  85.      designed for use with Microsoft  QuickBASIC 4.0 thru 4.5.  In addition
  86.      they will also work with  the new Microsoft  BASCOM 6.0 compiler. They
  87.      are not compatable with previous  versions of QuickBASIC or BASCOM and
  88.      no attempts should be made to use them with other versions.
  89.  
  90.      As noted above, this library contains  both subroutines and functions.
  91.      The difference is that subroutines  will perform the assigned task and
  92.      exit where as a function  will  perform an assigned task and  return a
  93.      value which can be used to assign a value to a  variable (ie  variable
  94.      = function) or be  part of an expression ( IF function = 0 THEN).   As
  95.      you can see, this makes  QB4BAS.LIB much more powerful  and  easier to
  96.      use than  its predecessor, QuickBas.LIB.   I would like to take credit
  97.      for this improvement but  the thanks belongs to Microsoft for creating
  98.      a powerful and impressive compiler.
  99.  
  100.      These routines are for whomever wants to use  them.  I am not charging
  101.      anything  as  long  as  they  are used for  personal  use or  freeware
  102.      programs.   If any of these  routines are  to be used in any  packages
  103.      that are to be sold  to  the public,  I feel it is only fair that I be
  104.      informed of  this use.  I also feel that  it  would  be appropriate in
  105.      this case to send me a small donation.  I am not in this to make money
  106.      but if someone else is going to make money from  my work, I should get
  107.      at least a little something from it.
  108.  
  109.      As you may have noticed, I did  not include  the source code for these
  110.      routines.  The reason for this is  to protect these routines  from any
  111.      changes which may cause  them  to no  longer function the way they are
  112.      documented.   I am  willing to accept any comments  or suggestions for
  113.      changes but I will  have  the final say on  what  happens.   I do  not
  114.      intend to make changes which would cause these routine not to function
  115.      as originally  documented unless  it is felt that these  changes  will
  116.      only improve the routines. Of course if this happens, I will make note
  117.      of it so please read  the #@!%$&  documentation.   (I  know, I hate to
  118.      read documentation almost as much as I hate writing it.)
  119.  
  120.      I  do  have  one thing that I  would  like to ask  of anyone who might
  121.      decide to use any or all of these routines, let me know what you think
  122.      of them.   I like  praise but I can also take criticism.  You can send
  123.      me a note at the address on the front cover.
  124.  
  125.  
  126.  
  127.      QB4BAS.LIB -- Version 4.5                                           ii
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      ACKNOWLEDGEMENTS
  137.  
  138.  
  139.      While developing the original  QuickBas.LIB routines, Charlie  Wooster
  140.      and  Terry Shockley where very helpful in testing the routines as well
  141.      as  suggesting several of the routines  that were  in the  library.  I
  142.      would also like to  extend thanks to  Charlie who spent a lot  of time
  143.      correcting problems encountered  in QMENU  as well  as  extending  its
  144.      capabilities by writing QMENUS.  Thanks to both of you.
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.      QB4BAS.LIB -- Version 4.5                                          iii
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      Many  of  the new routines in  version  2.0  were  written  for  Clint
  203.      Labarth, Sysop  of the Black Hole BBS in Orlando, for inclusion in his
  204.      new  release  of DoorPch routines which  are  used  with  PCBoard  for
  205.      writing doors.  Thanks for the suggestions, Clint.
  206.  
  207.      I have  also received several suggestions and comments  from different
  208.      people who have  taken the  time to try these routines.  It is good to
  209.      see that  these routines  are finally  starting to be noticed.  To all
  210.      who have written or called, thanks.
  211.  
  212.      Many of the  routines  contained in the QB4BAS.LIB were  derived  from
  213.      routines in  Leo J. Scanlons "Assembly Language Subroutines for MS-DOS
  214.      Computers".   This  is a very handy book  and if you don't have a copy
  215.      and like to write assembly programs,  I would recommend it. Another of
  216.      his books  that  I  use  quite  often is  "8086/88  Assembly  Language
  217.      Programming".  Page 100 is used quite often.
  218.  
  219.      The  QINPUT  routine included in the  library  was  developed from the
  220.      article "The  Finishing Strokes" by Hardin  Brothers in  the September
  221.      1987  (#6) issue of PCResource magazine.  Hardin has been writing good
  222.      articles for  some time now, I remember some from 80 MICRO, and he has
  223.      several  good ones in  PCResource.   I find this a  very good magazine
  224.      with a good amount of information on Quick Basic programming.
  225.  
  226.      The QCLOCK  routine supplied is based upon  the  CLOCK.ASM program  by
  227.      Robert J. Karp in the October 13, 1987 issue  (Vol 7, Number 17) of PC
  228.      Magazine.
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.      QB4BAS.LIB -- Version 4.5                                           iv
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      TABLE OF CONTENTS
  269.  
  270.  
  271.  
  272.  
  273.  
  274.      Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   ii
  275.      Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  iii
  276.  
  277.      Summary of Amendments   . . . . . . . . . . . . . . . . . . . . . .  1
  278.      Version 4.5 - Released 10/10/89   . . . . . . . . . . . . . . . . .  1
  279.      Version 4.2 - Released 07/17/89   . . . . . . . . . . . . . . . . .  2
  280.      Version 4.1 - Released 05/08/89   . . . . . . . . . . . . . . . . .  2
  281.      Version 4.0 - Released 04/15/89   . . . . . . . . . . . . . . . . .  2
  282.      Version 3.0 - Released 11/20/88   . . . . . . . . . . . . . . . . .  4
  283.      Version 2.0 - Released 03/15/88   . . . . . . . . . . . . . . . . .  4
  284.      Version 1.0 - Released 01/17/88   . . . . . . . . . . . . . . . . .  5
  285.  
  286.      Introduction  . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  287.      Requirements  . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  288.  
  289.      Dates   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  290.        QDATE    -- FUNCTION  . . . . . . . . . . . . . . . . . . . . . .  8
  291.        QDATECVT -- FUNCTION  . . . . . . . . . . . . . . . . . . . . . .  9
  292.        QDATEIN  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   10
  293.        QDATE2INT -- FUNCTION   . . . . . . . . . . . . . . . . . . . .   11
  294.        QINT2DATE -- FUNCTION   . . . . . . . . . . . . . . . . . . . .   11
  295.        QJULCALC -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   12
  296.  
  297.      Disk  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   13
  298.        QCNTFILE -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   13
  299.        QDISKSTAT -- SUB  . . . . . . . . . . . . . . . . . . . . . . .   13
  300.        QDISKTYP  -- SUB  . . . . . . . . . . . . . . . . . . . . . . .   14
  301.        QDRVSPACE -- FUNCTION   . . . . . . . . . . . . . . . . . . . .   14
  302.        QGETDRV  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   15
  303.        QGETVOL  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   15
  304.        QSETDRV  -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   15
  305.        QSETVOL  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   16
  306.  
  307.      File  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   17
  308.        QCOPYFIL -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   17
  309.        QDELETE  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   17
  310.        QEXIST   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   18
  311.        QFATTR   -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   18
  312.        QFCLOSE  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   19
  313.        QFCREATE -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   20
  314.        QFDATE   -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   21
  315.        QFINDFIRST -- FUNCTION  . . . . . . . . . . . . . . . . . . . .   22
  316.        QFINDNEXT -- FUNCTION   . . . . . . . . . . . . . . . . . . . .   23
  317.        QFINDF   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   24
  318.        QFINDN   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   24
  319.        QFLOF    -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   25
  320.        QFNAME   -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   25
  321.        QFOPEN   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   26
  322.        QFREAD   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   27
  323.  
  324.  
  325.      QB4BAS.LIB -- Version 4.5                                            v
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.        QFSETEND -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   28
  335.        QFSETREC QFSETRECL-- FUNCTION   . . . . . . . . . . . . . . . .   28
  336.        QFSIZE   -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   29
  337.        QFSTAMP  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   29
  338.        QFTIME   -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   30
  339.        QFWRITE  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   31
  340.        QMOVEFIL -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   32
  341.        QPARSEF  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   33
  342.        QRENAME  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   34
  343.        QTREAD   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   35
  344.        QTWRITE  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   36
  345.  
  346.      Keyboard  . . . . . . . . . . . . . . . . . . . . . . . . . . . .   38
  347.        QALTKEY  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   38
  348.        QCAPSKEY -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   38
  349.        QCTRLKEY -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   39
  350.        QGETKEY  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   39
  351.        QINKEY   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   40
  352.        QINPUT   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   41
  353.        QINPUTM  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   43
  354.        QKEYFLAG -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   44
  355.        QKEYSTAT -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   44
  356.        QPOPMENU -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   45
  357.        QMENU    -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   48
  358.        QMENUS   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   51
  359.        QNUMKEY  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   54
  360.        QSCRLKEY -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   54
  361.        QYESNO   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   55
  362.  
  363.      Miscellaneous   . . . . . . . . . . . . . . . . . . . . . . . . .   56
  364.        QALARM   -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   56
  365.        QARGC QARGV -- FUNCTION   . . . . . . . . . . . . . . . . . . .   56
  366.        QCAPSOFF QCAPSON -- SUB   . . . . . . . . . . . . . . . . . . .   57
  367.        QCLOCK   -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   58
  368.        QCMDLEN  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   59
  369.        QCMDLINE -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   59
  370.        QCRCCHK QCRCSET -- FUNCTION   . . . . . . . . . . . . . . . . .   60
  371.        QDOSVER  -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   60
  372.        QEMSSIZE -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   61
  373.        QEMSEXIST -- FUNCTION   . . . . . . . . . . . . . . . . . . . .   61
  374.        QEQUIPMENT -- SUB   . . . . . . . . . . . . . . . . . . . . . .   62
  375.        QEXIT    -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   62
  376.        QINPORT  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   63
  377.        QMININT QMAXINT -- FUNCTION   . . . . . . . . . . . . . . . . .   63
  378.        QMINLONG QMAXLONG -- FUNCTION   . . . . . . . . . . . . . . . .   64
  379.        QNUMLOCKOFF QNUMLOCKON -- SUB   . . . . . . . . . . . . . . . .   64
  380.        QPRINTER -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   65
  381.        QPRTSCRN -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   65
  382.        QPRTSCRNOFF QPRTSCRNON -- SUB   . . . . . . . . . . . . . . . .   66
  383.        QPAUSE   -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   66
  384.        QPAUSE18 -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   67
  385.        QREBOOT  -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   67
  386.        QSHIFTIL QSHIFTIR -- FUNCTION   . . . . . . . . . . . . . . . .   68
  387.        QSHIFTLL QSHIFTLR -- FUNCTION   . . . . . . . . . . . . . . . .   68
  388.        QSCROLLOFF QSCROLLON -- SUB   . . . . . . . . . . . . . . . . .   69
  389.  
  390.  
  391.      QB4BAS.LIB -- Version 4.5                                           vi
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.        QTIME    -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   69
  401.        QTEMPC   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   70
  402.        QTEMPF   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   70
  403.        QVERIFY  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   71
  404.        QVERIFYOFF QVERIFYON -- SUB   . . . . . . . . . . . . . . . . .   71
  405.        Q8087    -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   72
  406.  
  407.      String  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   73
  408.        QCAPIT   -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   73
  409.        QCENTER  -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   73
  410.        QCHARTYP -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   74
  411.        QDELIM   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   74
  412.        QEXTRACT -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   75
  413.        QHIGHBIT -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   75
  414.        QINSTR   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   76
  415.        QLEN     -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   76
  416.        QMID     -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   77
  417.        QMOVREC  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   77
  418.        QMOVSTR  -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   78
  419.        QREPLACE -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   78
  420.        QREVERSE -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   79
  421.        QRINSTR  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   79
  422.        QSTRIP   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   80
  423.        QSTRPCHR -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   80
  424.        QSUBSTR  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   81
  425.        QWORD    -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   81
  426.        QWORDS   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   82
  427.  
  428.      Sub-Directory   . . . . . . . . . . . . . . . . . . . . . . . . .   83
  429.        QCHDIR   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   83
  430.        QCHKDIR  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   83
  431.        QGETDIR  -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   84
  432.        QMKDIR   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   84
  433.        QRMDIR   -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   84
  434.  
  435.      Video   . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   85
  436.        QANSIPRT -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   85
  437.        QATTR    -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   85
  438.        QBPRT    -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   86
  439.        QBMPRT   -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   87
  440.        QCRTMODE -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   88
  441.        QCLREOL  -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   88
  442.        QGETATTR -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   90
  443.        QGETCURS -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   90
  444.        QGETMODE -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   91
  445.        QMPRT    -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   92
  446.        QPAINT   -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   93
  447.        QPRT     -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   94
  448.        QPRTANSI -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   95
  449.        QRESTSCR -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   96
  450.        QSAVESCR -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   97
  451.        QSCROLL  -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   98
  452.        QSCROLLB -- SUB   . . . . . . . . . . . . . . . . . . . . . . .   98
  453.        QSCRREST -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .   99
  454.        QSCRSAVE -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .  100
  455.  
  456.  
  457.      QB4BAS.LIB -- Version 4.5                                          vii
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.        QSETMODE -- SUB   . . . . . . . . . . . . . . . . . . . . . . .  101
  467.        QWINDOW  -- SUB   . . . . . . . . . . . . . . . . . . . . . . .  102
  468.        QWINDOWH -- SUB   . . . . . . . . . . . . . . . . . . . . . . .  103
  469.        QWINDOWV -- SUB   . . . . . . . . . . . . . . . . . . . . . . .  104
  470.        QWINDOWX -- SUB   . . . . . . . . . . . . . . . . . . . . . . .  105
  471.        QVIDREST -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .  106
  472.        QVIDSAVE -- FUNCTION  . . . . . . . . . . . . . . . . . . . . .  106
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.      QB4BAS.LIB -- Version 4.5                                         viii
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.      SUMMARY OF AMENDMENTS
  533.  
  534.  
  535.  
  536.      VERSION 4.5 - RELEASED 10/10/89
  537.  
  538.  
  539.      NEW ROUTINES
  540.  
  541.      File             QFSETRECL
  542.  
  543.      Miscellaneous    QARGC QARGV
  544.  
  545.      String           QREVERSE
  546.  
  547.      ROUTINES CORRECTED
  548.  
  549.      QWINDOWX         Correct documentation for DECLARE
  550.      QINPUT QINPUTM   Would not accept 2 as valid number of keys
  551.      QCHARTYP         Returning wrong results
  552.  
  553.      ROUTINES REVISED
  554.  
  555.      QCMDLINE         Now returns a string variable
  556.      QDATE            Now returns a string variable
  557.      QDATECVT         Now returns a string variable
  558.      QDATEIN          Now returns a string variable
  559.      QDELIM           Now returns a string variable
  560.      QEXIST           Can now also check for existance of directorys
  561.      QEXTRACT         Now returns a string variable
  562.      QGETDIR          Now returns a string variable
  563.      QGETDRV          Now returns a string variable
  564.      QGETVOL          Now returns a string variable
  565.      QINT2DTE         Now returns a string variable
  566.      QMOVREC          Now returns a string variable
  567.      QREVERSE         Now returns a string variable
  568.      QSTRIP           Now returns a string variable
  569.      QSTRPCHR         Now returns a string variable
  570.      QSUBSTR          Now returns a string variable
  571.      QWORD            Now returns a string variable
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.      Summary of Amendments                                                1
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.      VERSION 4.2 - RELEASED 07/17/89
  599.  
  600.  
  601.      NEW ROUTINES
  602.  
  603.      File             QFLOF QPARSEF
  604.  
  605.      Keyboard         QINPUTM
  606.  
  607.      Miscellaneous    QCMDLEN QREBOOT (Really)
  608.  
  609.      String           QMID QSTRIP QSTRPCHR QSUBSTR
  610.  
  611.      ROUTINES CORRECTED
  612.  
  613.      QFSETREC         Now can select first record.
  614.      QCRTMODE         Support added to test for VGA monitor.
  615.  
  616.  
  617.  
  618.      VERSION 4.1 - RELEASED 05/08/89
  619.  
  620.  
  621.      NEW ROUTINES
  622.  
  623.      Disk             QSETVOL
  624.  
  625.      Keyboard         QALTKEY QCAPSKEY  QCAPSON  QCAPSOFF QCNTLKEY  QNUMKEY
  626.                       QSCRLKEY QSCROLLON QSCROLLOFF QYESNO
  627.  
  628.      Miscellaneous    QTEMPC QTEMPF Q8087
  629.  
  630.      String           QHIGHBIT QLEN
  631.  
  632.  
  633.  
  634.      VERSION 4.0 - RELEASED 04/15/89
  635.  
  636.  
  637.      NEW ROUTINES
  638.  
  639.      Disk             QDISKTYP
  640.  
  641.      File             QFSTAMP QTREAD QTWRITE
  642.  
  643.      Miscellaneous    QMAXINT QMININT  QMAXLONG QMINLONG QSHIFTIL  QSHIFTIR
  644.                       QSHIFTLL  QSHIFTLR   QVERIFY   QVERIFYON   QVERIFYOFF
  645.                       QEMSEXIST
  646.  
  647.      String           QCAPIT QCENTER QCHARTYP
  648.  
  649.      Video            QCLREOL QGETMODE QPAINT QRESTSCR QSAVESCR QSETMODE
  650.  
  651.      ROUTINES CORRECTED
  652.  
  653.  
  654.  
  655.      Summary of Amendments                                                2
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.      QCOPYFIL         Increased copy buffer from 1K to 2K.
  665.      QMOVEFIL         Increased move buffer from 1K to 2K.
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.      Summary of Amendments                                                3
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.      VERSION 3.0 - RELEASED 11/20/88
  731.  
  732.  
  733.      NEW ROUTINES
  734.  
  735.      Disk             QCNTFILE QGETVOL
  736.  
  737.      File             QFINDFIRST QFINDNEXT
  738.  
  739.      Keyboard         QPOPMENU
  740.  
  741.      Miscellaneous    QBYTES
  742.  
  743.      String           QMOVREC QMOVSTR
  744.  
  745.      Video            QWINDOWX
  746.  
  747.      ROUTINES CORRECTED
  748.  
  749.      QINPUT           No longer hangs certain systens on exit.
  750.      QSCROLL          No longer hangs certain systems on exit.
  751.      QSCROLLB         No longer hangs certain systems on exit.
  752.      QSCRREST         Now works with monochrome monitors.
  753.      QSCRSAVE         Now works with monochrome monitors.
  754.  
  755.  
  756.  
  757.      VERSION 2.0 - RELEASED 03/15/88
  758.  
  759.  
  760.      NEW ROUTINES
  761.  
  762.      Date             QDATE2INT QINT2DATE
  763.  
  764.      Disk             QDSKSTAT QDRVSPC
  765.  
  766.      Keyboard         QGETKEY QINKEY QKEYSTAT
  767.  
  768.      Miscellaneous    QINPORT QTIMER
  769.  
  770.      Video            QCRTMODE QGETATTR QGETCURS QPRTANSI
  771.  
  772.      ROUTINES CORRECTED
  773.  
  774.      QEXIT            Now resets either Mono or CGA cursor.
  775.      QWORDS           Now returns 0 for null strings.
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.      Summary of Amendments                                                4
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.      VERSION 1.0 - RELEASED 01/17/88
  797.  
  798.  
  799.      CONVERTED ROUTINES from QuickBas.LIB Version 3.0
  800.  
  801.      Date             QDATE QDATECVT QDATEIN QJULCALC
  802.  
  803.      Disk             QGETDRV QSETDRV
  804.  
  805.      File             QCOPYFIL  QDELETE  QEXIST  QFATTR  QFCLOSE   QFCREATE
  806.                       QFOPEN QFREAD QFSETEND QFSETREC QFWRITE QFDATE QFINDF
  807.                       QFINDN QFNAME QFSIZE QFTIME QMOVEFIL QRENAME
  808.  
  809.      KeyBoard         QINPUT QMENU QMENUS
  810.  
  811.      Miscellaneous    QALARM  QCLOCK   QCMDLINE   QCRCCHK  QCRCSET  QDOSVER
  812.                       QEMSSIZE   QEQUIPMENT  QEXIT  QNUMLOCKOFF  QNUMLOCKON
  813.                       QPRINTER   QPRTSCRN  QPRTSCRNOFF   QPRTSCRNON  QPAUSE
  814.                       QPAUSE18
  815.  
  816.      String           QDELIM QEXTRACT QREPLACE QWORD QWORDS
  817.  
  818.      Sub-Directory    QCHDIR QCHKDIR QGETDIR QMKDIR QRMDIR
  819.  
  820.      Video            QANSIPRT   QATTR  QBPRT  QPRT  QBMPRT  QMPRT  QSCROLL
  821.                       QSCROLLB  QSCRREST QSCRSAVE QWINDOW QWINDOWH QWINDOWV
  822.                       VIDREST VIDSAVE
  823.  
  824.      DELETED ROUTINES from QuickBas.LIB Version 3.0
  825.  
  826.      String           QLOWER QUPPER
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.      Summary of Amendments                                                5
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.      INTRODUCTION
  863.  
  864.  
  865.  
  866.      QB4BAS  is  a  collection  of  subroutine  and  functions  written  in
  867.      Assembler for  the  Microsoft QuickBASIC 4.0 thru 4.5 compilers.   The
  868.      routines will also work with the Microsoft BASIC 6.0 compiler. Many of
  869.      the routines  are functionally  the  same  as routines found in  other
  870.      Basic  Library  packages. In addition,  I have added  several routines
  871.      that were  not  available and which I  find to be very helpful. I have
  872.      tested all  of  the routines  and they have worked for  me  on my AT&T
  873.      PC6300.  I am sure that they will work on any AT&T compatible machine.
  874.  
  875.      The files included in QB4BAS45.ZIP are as follows:
  876.  
  877.      QB4BAS.DOC     The QB4BAS library DOC.
  878.      QB4BAS.LIB     The QB4BAS library.
  879.      QB4BAS.QLB     The QB4BAS quick library.
  880.      QB4BAS.BI      Include file containing the necessary DECLAREs.
  881.      QB4OBJ.ZIP     The individual OBJ files to create a LIB.
  882.      QB4BAS.RSP     The response file used to create the .LIB file.
  883.      QB4QLB.RSP     The response file used to create the .QLB file.
  884.  
  885.  
  886.  
  887.      REQUIREMENTS
  888.  
  889.  
  890.      In  order  to use  the  functions or  routines in QB4BAS.LIB, you must
  891.      either add the DECLARE statements in the examples or include QB4BAS.BI
  892.      using the $INCLUDE metacommand.
  893.  
  894.      Most of the routines  in this library  require  that  either a  string
  895.      variable or a numeric variable be  passed with  the  call.  Whenever a
  896.      routine  requires a numeric variable, the variable must be defined  as
  897.      an integer  by either using the  DEFINT  statement  or  by  using  the
  898.      percent sign at the end of the variable name.
  899.  
  900.      Some routines require  that when a  string variable is used, it be set
  901.      to a minimum  size.  This is due to the limitations  placed upon me by
  902.      BASIC when using assembly language routines.  Always check the routine
  903.      format before using it.
  904.  
  905.      Whenever an array  is used in a call, double  check the  example to be
  906.      sure that the  proper calling format is  used.   Failure  to do so may
  907.      cause some of these routines fail or hang up your machine.
  908.  
  909.      I have received  some correspondence regarding linking  programs  with
  910.      the routines in  the .LIB  to create  an  .EXE file.  According to the
  911.      information from MicroSoft, only stand alone .EXE files can be creates
  912.      using  these routines, do not try to create an .EXE from within the QB
  913.      environment,  you must  compile the program using the BC compiler.  In
  914.      addition,  when using the BC compiler, you  must use the /O option  to
  915.      indicate that BCOM45.LIB will be used to link the program.
  916.  
  917.  
  918.  
  919.      Introduction                                                         6
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.      The proper format is:
  929.  
  930.        BC mypgm /O;
  931.  
  932.      The format of the link command is as follows:
  933.  
  934.        LINK /E mypgm+NOCOM, , ,BCOM45+QB4BAS;
  935.  
  936.      I hope that this clears  up  any problems that anyone has been  having
  937.      with the routines.
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.      Introduction                                                         7
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.      DATES
  995.  
  996.  
  997.  
  998.      QDATE    -- FUNCTION
  999.  
  1000.  
  1001.      Returns a variety of date information based upon the current date. The
  1002.      routine returns a string which contains  the requested information. It
  1003.      is  no longer necessary to pre-allocate the return string.  By using a
  1004.      variety of function codes, this function will return the alpha weekday
  1005.      (Sunday), the number  of days so far this  year (ddd), the Julian date
  1006.      (yyddd),  the  alpha month (June),  the default  date  format (dd  MMM
  1007.      yyyy),  the  USA  date  (mm/dd/yy), The European  date (dd/mm/yy), the
  1008.      ordered  date (yy/mm/dd) and the sorted  date (yyyymmdd).  If an error
  1009.      is encountered, a null string will be returned.
  1010.  
  1011.      The format of the call is as follows:
  1012.  
  1013.        Buffer$ = QDATE(FuncCode$)
  1014.  
  1015.      The following are the valid Function Codes:
  1016.  
  1017.        D  - Day of the year  : ddd
  1018.        E  - European date    : dd/mm/yy
  1019.        J  - Julian date      : yyddd
  1020.        M  - Month            : name of month, RC = length
  1021.        N  - Normal           : dd MMM yyyy  (30 Sep 1987)
  1022.        O  - Ordered date     : yy/mm/dd
  1023.        S  - Sorted date      : yyyymmdd
  1024.        U  - USA date         : mm/dd/yy
  1025.        W  - Weekday          : day of the week, RC = length
  1026.  
  1027.      Example:
  1028.  
  1029.        DEFINT A-Z
  1030.        DECLARE FUNCTION QDATE$ (FunCode AS STRING)
  1031.         .
  1032.        REM Print the day of the week
  1033.        FuncCode$ = "W"
  1034.        Buffer$ = QDATE(FuncCode$)
  1035.        IF Buffer$ <> "" THEN
  1036.           PRINT "Today is " Buffer$
  1037.        END IF
  1038.         .
  1039.        REM Print the normal date
  1040.        FuncCode$ = "N"
  1041.        Buffer$ = QDATE(FuncCode$)
  1042.        IF Buffer$ <> "" THEN
  1043.           PRINT "Today is " Buffer$
  1044.        END IF
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.      Dates                                                                8
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.      QDATECVT -- FUNCTION
  1061.  
  1062.  
  1063.      Converts either a gregorian date to julian (IN = mm/dd/yy OUT = yyddd)
  1064.      or a julian  date  to  gregorian date (IN = yyddd OUT = mm/dd/yy). The
  1065.      conversion is based upon  a  function  code  which is  passed with the
  1066.      call.  If an error is encountered, a null string will returned.
  1067.  
  1068.      The format of the call is as follows:
  1069.  
  1070.        OutDate$ = QDATECVT(Indate$, FuncCode$)
  1071.  
  1072.      The following are the valid Function Codes:
  1073.  
  1074.        J  - Converts gregorian to julian
  1075.        G  - Converts julian to gregorian
  1076.  
  1077.      Example:
  1078.  
  1079.        DEFINT A-Z
  1080.        DECLARE FUNCTION QDATECVT$ (InDate AS STRING, _
  1081.                                    FunCode AS STRING)
  1082.         .
  1083.        REM Convert to julian
  1084.        InDate$   = "05/29/87"
  1085.        FuncCode$ = "J"
  1086.        OutDate$ = QDATECVT(InDate$, FuncCode$)
  1087.        IF OutDate$ <> "" THEN
  1088.           PRINT "The julian date is " OutDate$
  1089.        END IF
  1090.         .
  1091.        REM Convert to gregorian
  1092.        InDate$   = "87149"
  1093.        FuncCode$ = "G"
  1094.        OutDate$ = QDATECVT(InDate$, FuncCode$)
  1095.        IF OutDate$ <> "" THEN
  1096.           PRINT "The gregorian date is " OutDate$
  1097.        END IF
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.      Dates                                                                9
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.      QDATEIN  -- FUNCTION
  1127.  
  1128.  
  1129.      Returns a  variety of  date  information  based upon  a date  which is
  1130.      included in  the  call.  The date in is in the format of  MM/DD/YY  or
  1131.      MM/DD/YYYY.  If the  year is YY then  1900  is assumed. By supplying a
  1132.      function code, this routine returns a string which contains either the
  1133.      alpha weekday (Sunday), the number of days so far this year (ddd), the
  1134.      Julian date (yyddd),  the  alpha month (June), the default date format
  1135.      (dd MMM  yyyy), the USA date (mm/dd/yy), The European date (dd/mm/yy),
  1136.      the  ordered date  (yy/mm/dd)  and  the sorted date  (yyyymmdd). If an
  1137.      error is, a null string is returned.
  1138.  
  1139.      The format of the call is as follows:
  1140.  
  1141.        Buffer$ = QDATEIN(InDate$, FuncCode$)
  1142.  
  1143.      The following are the valid Function Codes:
  1144.  
  1145.        D  - Day of the year  : ddd
  1146.        E  - European date    : dd/mm/yy
  1147.        J  - Julian date      : yyddd
  1148.        M  - Month            : name of month, RC = length
  1149.        N  - Normal           : dd MMM yyyy  (30 Sep 1987)
  1150.        O  - Ordered date     : yy/mm/dd
  1151.        S  - Sorted date      : yyyymmdd
  1152.        U  - USA date         : mm/dd/yy
  1153.        W  - Weekday          : day of the week, RC = length
  1154.  
  1155.      Example:
  1156.  
  1157.        DEFINT A-Z
  1158.        DECLARE FUNCTION QDATEIN$ (InDate AS STRING, _
  1159.                                   FunCode AS STRING)
  1160.         .
  1161.        REM Print the day of the week
  1162.        InDate$   = "10-18-1987"
  1163.        FuncCode$ = "W"
  1164.        Buffer$ = QDATEIN(InDate$, FuncCode$)
  1165.        IF Buffer$ <> "" THEN
  1166.           PRINT "Today is " Buffer$
  1167.        END IF
  1168.         .
  1169.        REM Print the normal date
  1170.        FuncCode$ = "N"
  1171.        Buffer$ = QDATEIN(InDate$, FuncCode$)
  1172.        IF Buffer$ <> "" THEN
  1173.           PRINT "Today is " Buffer$
  1174.        END IF
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.      Dates                                                               10
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.      QDATE2INT -- FUNCTION
  1193.  
  1194.  
  1195.      Compress an 8 byte string date (XX/XX/XX)  into a 2 byte integer. This
  1196.      function can be  used to  compress a date  to be  written to a file to
  1197.      save 6 bytes per date written.
  1198.  
  1199.      The format of the call is as follows:
  1200.  
  1201.        HoldDate = QDATE2INT(InDate$)
  1202.  
  1203.      Example:
  1204.  
  1205.        DEFINT A-Z
  1206.        DECLARE FUNCTION QDATE2INT% (InDate AS STRING)
  1207.         .
  1208.        InDate$ = "05/29/48"
  1209.        HoldDate = QDATE2INT(InDate$)
  1210.  
  1211.  
  1212.  
  1213.      QINT2DATE -- FUNCTION
  1214.  
  1215.  
  1216.      Uncompress  a  2 byte integer date  which  has been  compressed  using
  1217.      QDATE2INT back into an 8 byte string date (XX/XX/XX).
  1218.  
  1219.      The format of the call is as follows:
  1220.  
  1221.        OutDate$ = QINT2DATE(InDate)
  1222.  
  1223.      Example:
  1224.  
  1225.        DEFINT A-Z
  1226.        DECLARE FUNCTION QDATE2INT% (InDate AS STRING)
  1227.        DECLARE FUNCTION QINT2DATE$ (BYVAL InDate AS INTEGER)
  1228.         .
  1229.        InDate$ = "05/29/48"
  1230.        HoldDate = QDATE2INT(InDate$)
  1231.        OutDate$ = QINT2DATE(HoldDate)
  1232.        PRINT "The date is " OutDate$
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.      Dates                                                               11
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.      QJULCALC -- FUNCTION
  1259.  
  1260.  
  1261.      Either adds or subtracts from a julian date.   The julian date must be
  1262.      passed as a string and the  amount  to  add  or subtract  must  be  an
  1263.      integer.  This function allows for  leap years.  If  there is an error
  1264.      encountered, the RC will be set to -1.
  1265.  
  1266.      The format of the call is as follows:
  1267.  
  1268.        RC = QJULCALC(Calcdate$, Amount)
  1269.  
  1270.      Example:
  1271.  
  1272.        DEFINT A-Z
  1273.        DECLARE FUNCTION QJULCALC% (CalcDate AS STRING, _
  1274.                                    BYVAL Amount AS INTEGER)
  1275.         .
  1276.        REM Add 25 days to "87214"
  1277.        CalcDate$ = "87214"
  1278.        Amount    = 25
  1279.        IF QJULCALC(CalcDate$, Amount) = 0 THEN
  1280.           PRINT "The new julian date is " CalcDate$
  1281.        END IF
  1282.         .
  1283.        REM Subtract 25 days from "87214"
  1284.        CalcDate$ = "87214"
  1285.        Amount    = -25
  1286.        IF QJULCALC(CalcDate$, Amount) = 0 THEN
  1287.           PRINT "The new julian date is " CalcDate$
  1288.        END IF
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.      Dates                                                               12
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.      DISK
  1325.  
  1326.  
  1327.  
  1328.      QCNTFILE -- FUNCTION
  1329.  
  1330.  
  1331.      Retrieves the number  of files in  the  requested path  that match the
  1332.      search string.
  1333.  
  1334.      The format of the call is as follows:
  1335.  
  1336.        FileCnt = QCNTFILE(InFileName AS STRING)
  1337.  
  1338.      Example:
  1339.  
  1340.        DEFINT A-Z
  1341.        DECLARE FUNCTION QCNTFILE% (InFileName AS STRING) _
  1342.                                    BYVAL Attr AS INTEGER)
  1343.        InFileName$ = "C:\TESTPATH" + CHR$(0)
  1344.        Attr = 32
  1345.        Cnt = QCNTFILE(InFileName$, Attr)
  1346.        PRINT "Number of files is " + STR$(Cnt)
  1347.  
  1348.  
  1349.  
  1350.      QDISKSTAT -- SUB
  1351.  
  1352.  
  1353.      Retrieves  information  on  the requested disk drive.  The information
  1354.      returned is  the free clusters, total  clusters, bytes  per sector and
  1355.      the number of sectors per cluster
  1356.  
  1357.      The format of the call is as follows:
  1358.  
  1359.        QDISKSTAT Drv$, FClusters, TotClusters, BytesSector, SectorsCluster
  1360.  
  1361.      Example:
  1362.  
  1363.        DEFINT A-Z
  1364.        DECLARE SUB QDISKSTAT (DrvName AS STRING, _
  1365.                               FreeClusters AS INTEGER, _
  1366.                               TotClusters AS INTEGER, _
  1367.                               BytesSector AS INTEGER, _
  1368.                               SectorsCluster AS INTEGER)
  1369.        Drv$="C:\"
  1370.        QDISKSTAT Drv$, FClusters, TotClusters, BytesSector, SectorsCluster
  1371.        PRINT "Drive "+Drv$+" has "+STR$(SectorsCluster)+" Clusters/Sector."
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.      Disk                                                                13
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.      QDISKTYP  -- SUB
  1391.  
  1392.  
  1393.      Returns a return code which indicates the type of disk for the current
  1394.      logged drive.  A return code of 0 indicates the it is a  hard drive, a
  1395.      1 indicates  a  floppy disk and  a -1 indicates that the type of  disk
  1396.      could not be determined.
  1397.  
  1398.      The format of the call is as follows:
  1399.  
  1400.        RC = QDISKTYP()
  1401.  
  1402.      Example:
  1403.  
  1404.        DEFINT A-Z
  1405.        DECLARE FUNCTION QDISKTYP% ()
  1406.        RC = QDISKTYP()
  1407.        IF RC = 0 THEN
  1408.           PRINT "The current logged disk is a hard disk"
  1409.        ELSEIF RC = 1 THEN
  1410.           PRINT "The current logged disk is a floppy disk"
  1411.        ELSE
  1412.           PRINT "The current logged disk type cannot be determined"
  1413.        END IF
  1414.  
  1415.  
  1416.  
  1417.      QDRVSPACE -- FUNCTION
  1418.  
  1419.  
  1420.      Retrieves the  total amount of free disk  space on  the requested disk
  1421.      drive.
  1422.  
  1423.      The format of the call is as follows:
  1424.  
  1425.        FreeSpace = QDRVSPACE(DrvStr$)
  1426.  
  1427.      Example:
  1428.  
  1429.        DEFINT A-Z
  1430.        DECLARE FUNCTION QDRVSPACE& (DrvName AS STRING)
  1431.        DrvStr$="C:\"
  1432.        FreeSpace = QDRVSPACE(DrvStr$)
  1433.        PRINT "Drive "+DrvStr$+" has "+STR$(FreeSpace)+" bytes."
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.      Disk                                                                14
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.      QGETDRV  -- FUNCTION
  1457.  
  1458.  
  1459.      Get the  current logged disk  drive.  It  is  no  longer necessary  to
  1460.      pre-allocate the return string.
  1461.  
  1462.      The format of the call is as follows:
  1463.  
  1464.        DrvStr$ = QGETDRV
  1465.  
  1466.      Example:
  1467.  
  1468.        DEFINT A-Z
  1469.        DECLARE FUNCTION QGETDRV$ ()
  1470.        DrvStr$ = QGETDRV
  1471.        PRINT "The current disk is " DrvStr$
  1472.  
  1473.  
  1474.  
  1475.      QGETVOL  -- FUNCTION
  1476.  
  1477.  
  1478.      Get the volume label of the requested disk drive.  It is not necessary
  1479.      to pre-allocate the return string.
  1480.  
  1481.      The format of the call is as follows:
  1482.  
  1483.        VolId$ = QGETVOL
  1484.  
  1485.      Example:
  1486.  
  1487.        DEFINT A-Z
  1488.        DECLARE FUNCTION QGETVOL$ ()
  1489.        VolId$ = QGETVOL
  1490.        PRINT "The current disk label is " VolId$
  1491.  
  1492.  
  1493.  
  1494.      QSETDRV  -- SUB
  1495.  
  1496.  
  1497.      Change the current logged disk drive.
  1498.  
  1499.      The format of the call is as follows:
  1500.  
  1501.        QSETDRV NewDrv$
  1502.  
  1503.      Example:
  1504.  
  1505.        DEFINT A-Z
  1506.        DECLARE SUB QSETDRV (DrvName AS STRING)
  1507.        NewDrv$="C:"
  1508.        QSETDRV NewDrv$
  1509.  
  1510.  
  1511.  
  1512.  
  1513.      Disk                                                                15
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.      QSETVOL  -- FUNCTION
  1523.  
  1524.  
  1525.      This function will  set,  change  or  delete the  volume  label of the
  1526.      requested disk drive.  In  order to set  or change the vol  label, the
  1527.      string that is passed must be 11  characters long.  A  null string can
  1528.      be used to delete the current vol label.
  1529.  
  1530.      The format of the call is as follows:
  1531.  
  1532.        RC = QSETVOL(VolId$)
  1533.  
  1534.      Example:
  1535.  
  1536.        DEFINT A-Z
  1537.        DECLARE FUNCTION QSETVOL% (VolId AS STRING)
  1538.        VolId$ = "HAROLDSDISK"
  1539.        IF QSETVOL(VolId$) = 0 THEN
  1540.           PRINT "The Vol label has been set to " VolId$
  1541.        END IF
  1542.         .
  1543.        REM  The following will delete the current Vol label
  1544.        VolId$ = ""
  1545.        IF QSETVOL(VolId$) = 0 THEN
  1546.           PRINT "The Vol label has been deleted"
  1547.        END IF
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.      Disk                                                                16
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.      FILE
  1589.  
  1590.  
  1591.  
  1592.      QCOPYFIL -- FUNCTION
  1593.  
  1594.  
  1595.      Copies a file.  This is a better way of copying a file because it does
  1596.      not require the  SHELL command.  This routine will replace the file on
  1597.      the destination  device, use  QEXIST  to  check  if the  file  already
  1598.      exists.  Requires an ASCIIZ filename.  The return code will be  set if
  1599.      any errors are encountered.
  1600.  
  1601.      The format of the call is as follows:
  1602.  
  1603.        RC = QCOPYFIL(OldFile$, NewFile$)
  1604.  
  1605.      Example:
  1606.  
  1607.        DEFINT A-Z
  1608.        DECLARE FUNCTION QCOPYFIL% (InFileName AS STRING, _
  1609.                                    OutFileName AS STRING)
  1610.        OldFile$ = "TESTFILE.OLD"+CHR$(0)
  1611.        NewFile$ = "TESTFILE.NEW"+CHR$(0)
  1612.        IF QCOPYFIL(OldFile$, NewFile$) = 0 THEN
  1613.           PRINT "File copied"
  1614.        ELSE
  1615.           PRINT "File not copied"
  1616.        END IF
  1617.  
  1618.  
  1619.  
  1620.      QDELETE  -- FUNCTION
  1621.  
  1622.  
  1623.      Deletes a file.   Requires  an ASCIIZ filename without wildcards. Upon
  1624.      exit, a return code is set to indicate if the file was deleted or not.
  1625.  
  1626.      The format of the call is as follows:
  1627.  
  1628.        RC = QDELETE(DelFile$)
  1629.  
  1630.      Example:
  1631.  
  1632.        DEFINT A-Z
  1633.        DECLARE FUNCTION QDELETE% (FileName AS STRING)
  1634.         .
  1635.        DelFile$="QUICKBAS.LIB"+CHR$(0)
  1636.        IF QDELETE(DelFile$) = 0 THEN
  1637.           PRINT "File deleted"
  1638.        ELSE
  1639.           PRINT "File not deleted"
  1640.        END IF
  1641.  
  1642.  
  1643.  
  1644.  
  1645.      File                                                                17
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.      QEXIST   -- FUNCTION
  1655.  
  1656.  
  1657.      Tells you if  the  requested  file or  sub-directory  already  exists.
  1658.      Returns zero if it  does, or a  -1  if it doesn't.  Requires an ASCIIZ
  1659.      name without wildcards.
  1660.  
  1661.      The format of the call is as follows:
  1662.  
  1663.        RC = QEXIST(ChkFile$)
  1664.  
  1665.      Example:
  1666.  
  1667.        DEFINT A-Z
  1668.        DECLARE FUNCTION QEXIST% (FileName AS STRING)
  1669.        REM  For a sub-directory use ==> ChkFile$ = "\QB4\WORK" + CHR$(0)
  1670.        ChkFile$ = "FINDFILE.TXT" + CHR$(0)
  1671.        IF QEXIST(ChkFile$) = 0 THEN
  1672.           PRINT "File exists"
  1673.        ELSE
  1674.           PRINT "File not found"
  1675.        END IF
  1676.  
  1677.  
  1678.  
  1679.      QFATTR   -- SUB
  1680.  
  1681.  
  1682.      Returns the  file attribute  of a file that has been located by either
  1683.      QFINDF or subsequent calls  to QFINDN.   See the  information on these
  1684.      two calls before using this routine.
  1685.  
  1686.      The format of the call is as follows:
  1687.  
  1688.        QFATTR Attr
  1689.  
  1690.      The file attributes are as follows:
  1691.  
  1692.      Normal    - 00h   A normal file.
  1693.      Read-Only - 01h   File cannot be erased or rewritten.
  1694.      Hidden    - 02h   File info not displayed by DIR command.
  1695.      System    - 04h   Like hidden but for system (DOS,BIOS) files.
  1696.      Vol Label - 08h   A disk's vol label.
  1697.      Directory - 10h   A subdirectory.
  1698.      Archive   - 20h   Set after most backup programs run.
  1699.  
  1700.      Combinations of file attributes can be used.  An example is IBMDOS.COM
  1701.      which is usually a hidden, system, read-only, archive file.
  1702.  
  1703.      Example:
  1704.  
  1705.        DEFINT A-Z
  1706.        DECLARE SUB QFATTR (Attr AS INTEGER)
  1707.        QFATTR Attr
  1708.        PRINT "The file attribute is " Attr
  1709.  
  1710.  
  1711.      File                                                                18
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.      QFCLOSE  -- FUNCTION
  1721.  
  1722.  
  1723.      This function is  used  to  close  a file  which  was created  by  the
  1724.      QFCREATE routine or  opened by the QFOPEN routine.  This function must
  1725.      be called  after the QFCREATE or QFOPEN routines  to close the created
  1726.      or opened file.
  1727.  
  1728.      The function is called by passing the file "handle" which was returned
  1729.      by the QFCREATE or QFOPEN routine.  Upon return, the RC will either be
  1730.      zero indicating the file was closed or will be 6 indicating an invalid
  1731.      handle was specified.
  1732.  
  1733.      The format of the call is as follows:
  1734.  
  1735.        RC = QFCLOSE(FHandle)
  1736.  
  1737.      Example:
  1738.  
  1739.        DEFINT A-Z
  1740.        DECLARE FUNCTION QFCLOSE% (Handle AS INTEGER)
  1741.         .
  1742.        REM You must issue either a call to QFCREATE or QFOPEN first
  1743.         .
  1744.        IF QFCLOSE(FHandle) = 0 THEN
  1745.           Print "File Closed"
  1746.        ELSE
  1747.           Print "Invalid Handle, File Not Closed"
  1748.        END IF
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.      File                                                                19
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.      QFCREATE -- FUNCTION
  1787.  
  1788.  
  1789.      This function is  used  to  either  create  a  0 length  file  in  the
  1790.      specified  or defaulted  path  or  to initialize a file which  will be
  1791.      written to using QFWRITE.  The  QFCLOSE function must be used to close
  1792.      the file.
  1793.  
  1794.      The function is  called  by passing a file name which may include  the
  1795.      drive  and path).   The file name  must  end with a binary "0"  as the
  1796.      routine requires ASCIIZ names.   In addition, the  file attribute must
  1797.      be passed in the call, see QFATTR for information on  file attributes.
  1798.      Upon return, the  RC will  either  be  zero  indicating the  file  was
  1799.      created  or non-zero indicating  an error.  If  the RC  is  0 the file
  1800.      "handle"  will  be  in  the integer  variable  specified  as  the  3rd
  1801.      parameter.  If the RC is  3 the specified path was not found.   If the
  1802.      RC is 4 a file "handle" was not available.   If the RC is 5 access was
  1803.      denied.
  1804.  
  1805.      The format of the call is as follows:
  1806.  
  1807.        RC = QFCREATE(FileName$, Fattr, FHandle)
  1808.  
  1809.      Example:
  1810.  
  1811.        DEFINT A-Z
  1812.        DECLARE FUNCTION QFCREATE% (FileName AS STRING, _
  1813.                                    FileAttr AS INTEGER, _
  1814.                                    Handle AS INTEGER)
  1815.         .
  1816.        FileName$ = "C:\DEMO\TEST.DAT"+CHR$(0)
  1817.        Fattr = 0
  1818.        RC = QFCREATE(FileName$, Fattr, FHandle)
  1819.        IF RC = 0 THEN
  1820.           Print "File Created"
  1821.        ELSE
  1822.           Print "File Not Created";RC
  1823.        END IF
  1824.         .
  1825.        RC = QFCLOSE(FHandle)
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.      File                                                                20
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.      QFDATE   -- SUB
  1853.  
  1854.  
  1855.      Returns the date that the file  was  created or updated. The file must
  1856.      first located by a  call to  either  QFINDF  or  subsequent  calls  to
  1857.      QFINDN.   See  the information on these two  calls  before using  this
  1858.      routine.
  1859.  
  1860.      The format of the call is as follows:
  1861.  
  1862.        QFDATE Month, Day, Year
  1863.  
  1864.      Example:
  1865.  
  1866.        DEFINT A-Z
  1867.        DECLARE SUB QFDATE (Month AS INTEGER, _
  1868.                            Day AS INTEGER, _
  1869.                            Year AS INTEGER)
  1870.         .
  1871.        QFDATE Month, Day, Year
  1872.         .
  1873.        PRINT "The file date is " Month Day Year
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.      File                                                                21
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.      QFINDFIRST -- FUNCTION
  1919.  
  1920.  
  1921.      This  new function works  much  like the QFINDF  function  but, unlike
  1922.      QFINDF, it does  not  require  additional  calls to other routines  to
  1923.      retrieve  the information that you really wanted in the beginning. The
  1924.      file information  is  returned in a record which must  be defined with
  1925.      the TYPE command.  The necessary record TYPE is supplied in QB4BAS.BI.
  1926.      See below for an  example on  how to use it. This function will locate
  1927.      the  first file in  the  specified  or default path which  matches the
  1928.      specified file  name.  The file name may contain  wildcards (* and ?).
  1929.      Additional matching files may be found using the QFINDNEXT function.
  1930.  
  1931.      The function  is called by passing a  pointer to the  record where the
  1932.      file  information  is to  be placed.  A file name  (which  can contain
  1933.      wildcards "*" or "?" as  well  as the  drive and path) which  must end
  1934.      with a binary "0" as the  routine requires ASCIIZ names.  In addition,
  1935.      the  file  attribute  must  be passed in  the  call,  see  QFATTR  for
  1936.      information on file attributes.  Upon  return, the  RC  will either be
  1937.      zero, indicating that a  file  was found,  or  non-zero  indicating an
  1938.      error.  If the RC is -1 there was an error in the call.  If the  RC is
  1939.      a  2 the  specified path  is invalid.  If the  RC  is  18 there  is no
  1940.      matching file.
  1941.  
  1942.      The format of the call is as follows:
  1943.  
  1944.        RC = QFINDFIRST(RecAddr, ChkFile$, Fattr)
  1945.  
  1946.      Example:
  1947.  
  1948.        DEFINT A-Z
  1949.        DECLARE FUNCTION QFINDFIRST% (BYVAL RecPtr AS INTEGER, _
  1950.                                      FileName AS STRING, _
  1951.                                      BYVAL Attr AS INTEGER)
  1952.        TYPE FileType
  1953.             Fname AS STRING * 12
  1954.             Fdate AS STRING * 8
  1955.             Ftime AS STRING * 5
  1956.             Fsize AS LONG
  1957.             Fattr AS INTEGER
  1958.             Month AS INTEGER
  1959.             Day   AS INTEGER
  1960.             Year  AS INTEGER
  1961.             Hour  AS INTEGER
  1962.             Minute AS INTEGER
  1963.        END TYPE
  1964.         .
  1965.        DIM Qfile AS FileType
  1966.        Fptr = VARPTR(Qfile)
  1967.        ChkFile$="C:\DEMO\*.EXE"+CHR$(0)
  1968.        IF QFINDFIRST(Fptr, ChkFile$, 0) = 0 THEN
  1969.           Print Qfile.Fname, Qfile.Fdate, Qfile.Ftime, Qfile.Fsize
  1970.        END IF
  1971.  
  1972.  
  1973.  
  1974.  
  1975.      File                                                                22
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.      QFINDNEXT -- FUNCTION
  1985.  
  1986.  
  1987.      This  new function works  much  like the  QFINDN  function but, unlike
  1988.      QFINDN, it does  not  require  additional calls  to other routines  to
  1989.      retrieve the information that you  really wanted in the beginning. The
  1990.      file  information is  returned in a record  which must be defined with
  1991.      the TYPE command.  The necessary record TYPE is supplied in QB4BAS.BI.
  1992.      See below for an example  on  how to use it. This function will locate
  1993.      additional files after a successful call to QFINDFIRST.
  1994.  
  1995.      The function  is called by passing a pointer to the  record  where the
  1996.      file information is to be placed.   Upon return, the RC will either be
  1997.      zero indicating that a file was  found or  18 indicating there are  no
  1998.      more matching files.
  1999.  
  2000.      The format of the call is as follows:
  2001.  
  2002.        RC = QFINDNEXT(RecAddr)
  2003.  
  2004.      Example:
  2005.  
  2006.        DEFINT A-Z
  2007.        DECLARE FUNCTION QFINDNEXT% (BYVAL RecPtr AS INTEGER)
  2008.         .
  2009.        TYPE FileType
  2010.             Fname AS STRING * 12
  2011.             Fdate AS STRING * 8
  2012.             Ftime AS STRING * 5
  2013.             Fsize AS LONG
  2014.             Fattr AS INTEGER
  2015.             Month AS INTEGER
  2016.             Day   AS INTEGER
  2017.             Year  AS INTEGER
  2018.             Hour  AS INTEGER
  2019.             Minute AS INTEGER
  2020.        END TYPE
  2021.         .
  2022.        DIM Qfile AS FileType
  2023.        Fptr = VARPTR(Qfile)
  2024.        ChkFile$="C:\DEMO\*.EXE"+CHR$(0)
  2025.        IF QFINDFIRST(Fptr, ChkFile$, 0) = 0 THEN
  2026.           Print Qfile.Fname, Qfile.Fdate, Qfile.Ftime, Qfile.Fsize
  2027.           WHILE QFINDNEXT(Fptr) = 0
  2028.              Print Qfile.Fname, Qfile.Fdate, Qfile.Ftime, Qfile.Fsize
  2029.           WEND
  2030.        END IF
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.      File                                                                23
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.      QFINDF   -- FUNCTION
  2051.  
  2052.  
  2053.      This function  is used  to locate  the first file  in the specified or
  2054.      default path which matches the specified file name.  The file name may
  2055.      contain wildcards  (* and ?).  Additional matching files may be  found
  2056.      using the QFINDN  function.  This function must be called before calls
  2057.      to QFATTR, QFDATE, QFINDN, QFNAME, QFSIZE and QFTIME.
  2058.  
  2059.      The function  is called by  passing  a file  name (which  can  contain
  2060.      wildcards  "*" or "?" as well as the drive  and path).  The file  name
  2061.      must end with a binary  "0" as the  routine requires ASCIIZ names.  In
  2062.      addition, the  file  attribute must be passed in the call, see  QFATTR
  2063.      for information on file  attributes.  Upon  return, the RC will either
  2064.      be zero, indicating that a file  was found, or  non-zero indicating an
  2065.      error.  If the  RC is -1 there was an error in the call, a 2 indicates
  2066.      the specified path is invalid, an  18 indicates  there is no  matching
  2067.      file.
  2068.  
  2069.      The format of the call is as follows:
  2070.  
  2071.        RC = QFINDF(ChkFile$, Fattr)
  2072.  
  2073.      Example:
  2074.  
  2075.        DEFINT A-Z
  2076.        DECLARE FUNCTION QFINDF% (FileName AS STRING, BYVAL Attr AS INTEGER)
  2077.        RC = QFINDF("C:\DEMO\*.EXE"+CHR$(0), 0)
  2078.        IF RC < 0 THEN
  2079.           Print "Error in call."
  2080.        ELSEIF RC > 0 THEN
  2081.           Print "File not found."
  2082.        END IF
  2083.  
  2084.  
  2085.  
  2086.      QFINDN   -- FUNCTION
  2087.  
  2088.  
  2089.      This function is used to locate additional files beyond the file found
  2090.      by  the QFINDF  function. The  QFINDN  function reuses the  parameters
  2091.      passed to the QFINDF function to locate any additional files.   The RC
  2092.      will  zero  if a file  was found  or 18  if there are no more matching
  2093.      files.
  2094.  
  2095.      The format of the call is as follows:
  2096.  
  2097.        RC = QFINDN
  2098.  
  2099.      Example:
  2100.  
  2101.        DEFINT A-Z
  2102.        DECLARE FUNCTION QFINDN% ()
  2103.        IF QFINDN > 0 THEN  PRINT "No more files."
  2104.  
  2105.  
  2106.  
  2107.      File                                                                24
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.      QFLOF    -- FUNCTION
  2117.  
  2118.  
  2119.      This function is used to return the file size of an open file that was
  2120.      opened  with either QFOPEN or QFCREATE.  It  will return the file size
  2121.      whether  it has  been just opened  or if  it has  been  added to  with
  2122.      QFWRITE.  Be  careful  to  make  sure that  a long integer is  used to
  2123.      return the file size to.
  2124.  
  2125.      The format of the call is as follows:
  2126.  
  2127.        Fsize& = QFLOF(FHandle)
  2128.  
  2129.      Example:
  2130.  
  2131.        DEFINT A-Z
  2132.        DECLARE FUNCTION QFLOF& (Handle AS INTEGER)
  2133.        REM Open file for reading
  2134.        FileName$ = "C:\DEMO\TEST.DAT"+CHR$(0)
  2135.        Faccess = 1
  2136.        RC = QFOPEN(FileName$, Faccess, FHandle)
  2137.        Fsize& = QFLOF(FHandle)
  2138.        RC = QFCLOSE(FHandle)
  2139.  
  2140.  
  2141.  
  2142.      QFNAME   -- SUB
  2143.  
  2144.  
  2145.      Returns the name of the file that  was located  by  either  QFINDF  or
  2146.      subsequent calls  to QFINDN.  It  also returns the length  of the file
  2147.      name less trailing  spaces.  See the information on  these  two  calls
  2148.      before using this routine.
  2149.  
  2150.      The format of the call is as follows:
  2151.  
  2152.        QFNAME File$
  2153.  
  2154.      Example:
  2155.  
  2156.        DEFINT A-Z
  2157.        DECLARE SUB QFNAME (FileName AS STRING)
  2158.         .
  2159.        REM You must issue a call to either QFINDF or QFINDN first
  2160.         .
  2161.        File$ = Space$(12)
  2162.        QFNAME File$
  2163.        PRINT "The file name is " RTRIM$(File$)
  2164.         .
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.      File                                                                25
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.      QFOPEN   -- FUNCTION
  2183.  
  2184.  
  2185.      This function is  used to open an existing file.  The file can then be
  2186.      read by using QFREAD or  written  to by QFWRITE.  The QFCLOSE function
  2187.      must be used to close the file.
  2188.  
  2189.      The function  is called by passing a  file name which may include  the
  2190.      drive and path).   The file  name  must end with  a binary "0"  as the
  2191.      routine requires ASCIIZ  names.  In addition,  the file access must be
  2192.      passed  in the call, 0 to open for reading, 1 to open for writing or 2
  2193.      to open for both reading and writing.  Upon return, the RC will either
  2194.      be zero indicating  the  file  was  opened  or non-zero indicating  an
  2195.      error.   If  the RC  is  0 the file "handle"  will  be  in the integer
  2196.      variable specified as the 3rd parameter.  If the RC is 2 the specified
  2197.      path was not found.  If the RC is 4, then too many files open.  If the
  2198.      RC is 5,  then access was  denied.  If the  RC is  12, then an invalid
  2199.      access number was passed.
  2200.  
  2201.      The format of the call is as follows:
  2202.  
  2203.        RC = QFOPEN(FileName$, Faccess, FHandle)
  2204.  
  2205.      Example:
  2206.  
  2207.        DEFINT A-Z
  2208.        DECLARE FUNCTION QFOPEN% (FileName AS STRING, _
  2209.                                  Access AS INTEGER, _
  2210.                                  Handle AS INTEGER)
  2211.         .
  2212.        REM Open file for reading
  2213.        FileName$ = "C:\DEMO\TEST.DAT"+CHR$(0)
  2214.        Faccess = 0
  2215.        RC = QFOPEN(FileName$, Faccess, FHandle)
  2216.        IF RC = 0 THEN
  2217.           Print "File Opened"
  2218.        ELSE
  2219.           Print "File Not Opened";RC
  2220.        END IF
  2221.         .
  2222.        REM Open file for writing
  2223.        FileName$ = "C:\DEMO\TEST.DAT"+CHR$(0)
  2224.        Faccess = 1
  2225.        RC = QFOPEN(FileName$, Faccess, FHandle)
  2226.        IF RC = 0 THEN
  2227.           Print "File Opened"
  2228.        ELSE
  2229.           Print "File Not Opened";RC
  2230.        END IF
  2231.         .
  2232.        RC = QFCLOSE(FHandle)
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.      File                                                                26
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.      QFREAD   -- FUNCTION
  2249.  
  2250.  
  2251.      This  function is used to read a file which has been opened by QFOPEN.
  2252.      The calling sequence  requires  that a string  buffer  be passed which
  2253.      will  contain  the  requested  record upon  return.  In addition,  the
  2254.      length of the  record to read must be passed so that the  routine will
  2255.      know how many bytes to read.  Upon return, the string will contain the
  2256.      requested record and the actual number of bytes read will be returned.
  2257.      In addition,  the RC will either be zero indicating  that the read was
  2258.      successful  or non-zero indicating an error.  If  the RC is  -1, there
  2259.      was  an error  in one of the parameters.  If  the  RC is greater  than
  2260.      zero, DOS encountered an error reading the file.
  2261.  
  2262.      A  useful feature of this function is that block reads can be  done. A
  2263.      block  read is  reading  multiple  records at  a time.   If the record
  2264.      length is 50, by setting a buffer length to 500 will cause the routine
  2265.      to attempt to read 10 records.  The  bytes read count can then be used
  2266.      to determine exactly  how many  records were read.   The buffer can be
  2267.      split using the MID$ function to extract each record.
  2268.  
  2269.      The format of the call is as follows:
  2270.  
  2271.        RC = QFREAD(FHandle, FBuffer$, ReadLen, BytesRead)
  2272.  
  2273.      Example:
  2274.  
  2275.        DEFINT A-Z
  2276.        DECLARE FUNCTION QFREAD% (Handle AS INTEGER, _
  2277.                                  Buffer AS STRING, _
  2278.                                  ReadLen AS INTEGER, _
  2279.                                  BytesRead AS INTEGER)
  2280.         .
  2281.        REM Open file for reading
  2282.        FileName$ = "C:\DEMO\TEST.DAT"+CHR$(0)
  2283.        Faccess = 0
  2284.        RC = QFOPEN(FileName$, Faccess, FHandle)
  2285.         .
  2286.        FBuffer$ = Space$(50)
  2287.        ReadLen  = 50
  2288.        RC = QFREAD(FHandle, FBuffer$, ReadLen, BytesRead)
  2289.        IF RC <> 0 THEN
  2290.           PRINT "Error reading file"
  2291.           END
  2292.        ELSEIF BytesRead = 0 THEN
  2293.           PRINT "End of File"
  2294.        ELSE
  2295.           PRINT FBuffer$
  2296.        END IF
  2297.         .
  2298.        RC = QFCLOSE(FHandle)
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.      File                                                                27
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.      QFSETEND -- FUNCTION
  2315.  
  2316.  
  2317.      This function is used to set the file pointer to  the end of the file.
  2318.      The file must have been opened  using QFOPEN.  This function is useful
  2319.      to add new records to the end of  an  existing file.  Upon return, the
  2320.      RC will either  be zero indicating  success  or non-zero indicating an
  2321.      error.
  2322.  
  2323.      The format of the call is as follows:
  2324.  
  2325.        RC = QFSETEND(FHandle)
  2326.  
  2327.      Example:
  2328.  
  2329.        DEFINT A-Z
  2330.        DECLARE FUNCTION QFSETEND% (Handle AS INTEGER)
  2331.        FileName$ = "C:\DEMO\TEST.DAT"+CHR$(0)
  2332.        Faccess = 1
  2333.        RC = QFOPEN(FileName$, Faccess, FHandle)
  2334.        RC = QFSETEND(FHandle)
  2335.        REM New records can now be added.
  2336.        RC = QFCLOSE(FHandle)
  2337.  
  2338.  
  2339.  
  2340.      QFSETREC QFSETRECL-- FUNCTION
  2341.  
  2342.  
  2343.      These functions are used to set the file pointer for random reading or
  2344.      writing to  a  file that  has been opened  using QFOPEN.   The calling
  2345.      sequence  requires that the record length and the record number to set
  2346.      be passed in  the call.   Upon  return,  the  RC will either  be  zero
  2347.      indicating success or non-zero indicating an error.
  2348.  
  2349.      The format of the call is as follows:
  2350.  
  2351.        RC = QFSETREC(FHandle, RecLen, RecNum)
  2352.        RC = QFSETRECL(FHandle, RecLen, RecNum)
  2353.  
  2354.      Example:
  2355.  
  2356.        DEFINT A-Z
  2357.        DECLARE FUNCTION QFSETREC% (BYVAL Handle AS INTEGER, _
  2358.                                    BYVAL RecLen AS INTEGER, _
  2359.                                    BYVAL RecNum AS INTEGER)
  2360.        DECLARE FUNCTION QFSETRECL% (BYVAL Handle AS INTEGER, _
  2361.                                     BYVAL RecLen AS INTEGER, _
  2362.                                     BYVAL RecNum AS LONG)
  2363.        FileName$ = "C:\DEMO\TEST.DAT"+CHR$(0): Faccess = 0
  2364.        RC = QFOPEN(FileName$, Faccess, FHandle)
  2365.        RecLen = 50: RecNum& = 70000
  2366.        RC = QFSETRECL(FHandle, RecLen, RecNum&)
  2367.        REM Record 70000 can now be read.
  2368.        RC = QFCLOSE(FHandle)
  2369.  
  2370.  
  2371.      File                                                                28
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.      QFSIZE   -- SUB
  2381.  
  2382.  
  2383.      Returns the size  of the  file  that was  located by either QFINDF  or
  2384.      subsequent calls  to QFINDN.  See the  information on these  two calls
  2385.      before using this routine.   This routine returns the size of the file
  2386.      as a long integer, make sure you ues the correct type declaration.
  2387.  
  2388.      The format of the call is as follows:
  2389.  
  2390.        QFSIZE SizeFile&
  2391.  
  2392.      Example:
  2393.  
  2394.        DEFINT A-Z
  2395.        DECLARE SUB QFSIZE (Size AS LONG)
  2396.         .
  2397.        REM You must issue a call to either QFINDF or QFINDN first
  2398.        QFSIZE SizeFile&
  2399.        Print "File size is " SizeFile&
  2400.  
  2401.  
  2402.  
  2403.      QFSTAMP  -- FUNCTION
  2404.  
  2405.  
  2406.      This function is used to change the date and time that a file was last
  2407.      updated.  It  returns a zero if the request completed successfully. If
  2408.      there was and error in the information passed to the function,  then a
  2409.      -1  is  return.   If  there were any  DOS  error encountered,  then  a
  2410.      positive number will be returned.
  2411.  
  2412.      The format of the call is as follows:
  2413.  
  2414.        RC = QFSTAMP(Qname$, Qtime$, Qdate$)
  2415.  
  2416.      Example:
  2417.  
  2418.        DEFINT A-Z
  2419.        DECLARE FUNCTION QFSTAMP (Qname AS STRING, _
  2420.                                  Qtime AS STRING, _
  2421.                                  Qdate AS STRING)
  2422.         .
  2423.        Qname$ = "TEST.TST" + CHR$(0)
  2424.        Qtime$ = "13:10:00"
  2425.        Qdate$ = "12/12/88"
  2426.         .
  2427.        XX = QFSTAMP(Qname$, Qtime$, Qdate$)
  2428.         .
  2429.        END
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.      File                                                                29
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.      QFTIME   -- SUB
  2447.  
  2448.  
  2449.      Returns the time  that the file was created or updated.  The file must
  2450.      first  located  by a call  to  either QFINDF  or  subsequent  calls to
  2451.      QFINDN.  See the information on these  two  calls  before  using  this
  2452.      routine.
  2453.  
  2454.      The format of the call is as follows:
  2455.  
  2456.        QFTIME Hrs, Min
  2457.  
  2458.      Example:
  2459.  
  2460.        DEFINT A-Z
  2461.        DECLARE SUB QFTIME (Hrs AS INTEGER, _
  2462.                            Min AS INTEGER)
  2463.         .
  2464.        REM You must issue a call to either QFINDF or QFINDN first
  2465.        QFTIME Hrs, Min
  2466.        PRINT "The file time is " Hrs Min
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.      File                                                                30
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.      QFWRITE  -- FUNCTION
  2513.  
  2514.  
  2515.      This function is used to Write a file which has been opened by QFOPEN.
  2516.      The calling sequence  requires that  a string  buffer be  passed which
  2517.      will contain the data to be written.  In addition, the  length  of the
  2518.      record  to write must be passed so that the routine will know how many
  2519.      bytes to write.  Upon return, then actual number of bytes written will
  2520.      be returned.  In addition, the  RC will either be zero indicating that
  2521.      the write was successful or non-zero indicating  an error.  If  the RC
  2522.      is  -1,  there was an error  in one of the parameters.   If the RC  is
  2523.      greater than zero, DOS encountered an error writing to the file.
  2524.  
  2525.      The format of the call is as follows:
  2526.  
  2527.        RC = QFWRITE(FHandle, FBuffer$, WriteLen, BytesWritten)
  2528.  
  2529.      Example:
  2530.  
  2531.        DEFINT A-Z
  2532.        DECLARE FUNCTION QFWRITE% (Handle AS INTEGER, _
  2533.                                   Buffer AS STRING, _
  2534.                                   WriteLen AS INTEGER, _
  2535.                                   BytesWritten AS INTEGER)
  2536.         .
  2537.        REM Open file for writing
  2538.        FileName$ = "C:\DEMO\TEST.DAT"+CHR$(0)
  2539.        Faccess = 1
  2540.        RC = QFOPEN(FileName$, Faccess, FHandle)
  2541.         .
  2542.        FBuffer$ = "This is a record that will be written to the file."
  2543.        ReadLen  = LEN(FBuffer$)
  2544.        RC = QFWRITE(FHandle, FBuffer$, WriteLen, BytesWritten)
  2545.        IF RC <> 0 THEN
  2546.           PRINT "Error writing file"
  2547.           END
  2548.        ELSEIF BytesWritten <> WriteLen THEN
  2549.           PRINT "Error writing file"
  2550.        ELSE
  2551.           PRINT "Write successful"
  2552.        END IF
  2553.         .
  2554.        RC = QFCLOSE(FHandle)
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.      File                                                                31
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.      QMOVEFIL -- FUNCTION
  2579.  
  2580.  
  2581.      Moves a file.  It functions the same way as QCOPYFIL but the  original
  2582.      file will be deleted after the copy  is completed.  If the file is  to
  2583.      be moved to  a different  directory  on the same  device, it will move
  2584.      just the directory entry which will make the move  much faster.  If an
  2585.      error  is encountered, the  RC will  be set to  -1.  See  QCOPYFIL for
  2586.      additional information.
  2587.  
  2588.      The format of the call is as follows:
  2589.  
  2590.        RC = QMOVEFIL(OldFile$, NewFile$)
  2591.  
  2592.      Example:
  2593.  
  2594.        DEFINT A-Z
  2595.        DECLARE FUNCTION QMOVEFIL% (InFileName AS STRING, _
  2596.                                    OutFileName AS STRING)
  2597.         .
  2598.        REM Move a file from the A drive to the C drive
  2599.        OldFile$="A:TESTFILE.TXT"+CHR$(0)
  2600.        NewFile$="C:\TESTSUB\TESTFILE.TXT"+CHR$(0)
  2601.        IF QMOVEFIL(OldFile$, NewFile$) = 0 THEN
  2602.           PRINT "File moved"
  2603.        ELSE
  2604.           PRINT "File not moved"
  2605.        END IF
  2606.         .
  2607.         .
  2608.        REM Move a file to a different directory on the C drive
  2609.        OldFile$="TESTFILE.TXT"+CHR$(0)
  2610.        NewFile$="\TESTSUB\TESTFILE.TXT"+CHR$(0)
  2611.        IF QMOVEFIL(OldFile$, NewFile$) = 0 THEN
  2612.           PRINT "File moved"
  2613.        ELSE
  2614.           PRINT "File not moved"
  2615.        END IF
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.      File                                                                32
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.      QPARSEF  -- FUNCTION
  2645.  
  2646.  
  2647.      This function will parse a string which can contain a drive specifier,
  2648.      a path, a file name and  a file extention into individule pieces which
  2649.      will be returned in a  defined type record.  This function will return
  2650.      a -1 if the file name is longer than 8 characters.
  2651.  
  2652.      The TYPE description below is  contained in QB4BAS.BI  and  if  it  is
  2653.      included into the  program using the $INCLUDE meta command it will  be
  2654.      available to the program.  You will still have to DIM the record using
  2655.      whichever name that you wish to use.
  2656.  
  2657.      The format of the call is as follows:
  2658.  
  2659.        RC = PARSEF(Pstring$, Pseg, Pptr)
  2660.  
  2661.      Example:
  2662.  
  2663.        DEFINT A-Z
  2664.        DECLARE FUNCTION QPARSEF% (Pstring AS STRING, _
  2665.                                   BYVAL Pseg AS INTEGER, _
  2666.                                   BYVAL Pptr AS INTEGER)
  2667.        TYPE ParseType
  2668.             Pdrive AS STRING * 2
  2669.             Ppath AS STRING * 64
  2670.             Pname AS STRING * 8
  2671.             Pext AS STRING * 3
  2672.        END TYPE
  2673.  
  2674.        DIM FileRec AS ParseType
  2675.  
  2676.        Pseg = VARSEG(FileRec)
  2677.        Pptr = VARPTR(FileRec)
  2678.        Pstring$ = "D:\PATH1\PATH2\THISTEST.DAT"
  2679.  
  2680.        IF QPARSEF(Pstring$, Pseg, Pptr) = 0 THEN
  2681.           PRINT "1 " + FileRec.Pdrive
  2682.           PRINT "2 " + FileRec.Ppath
  2683.           PRINT "3 " + FileRec.Pname
  2684.           PRINT "4 " + FileRec.Pext
  2685.        END IF
  2686.  
  2687.        END
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.      File                                                                33
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.      QRENAME  -- FUNCTION
  2711.  
  2712.  
  2713.        Rename an existing file.  Can also be used to move a file from one
  2714.        sub-directory to another.  Requires an ASCIIZ filename without
  2715.        wildcards for both files.  If an error is encountered, the RC will be
  2716.        set to -1.
  2717.  
  2718.        The format of the call is as follows:
  2719.  
  2720.          RC = QRENAME(OldFile$, NewFile$)
  2721.  
  2722.        Example:
  2723.  
  2724.          DEFINT A-Z
  2725.          DECLARE FUNCTION QRENAME% (InFileName AS STRING, _
  2726.                                     OutFileName AS STRING)
  2727.           .
  2728.          REM Rename a file
  2729.          OldFile$="\FIRSTDIR\MYFILE.TXT"+CHR$(0)
  2730.          NewFile$="MYFILE.DOC"+CHR$(0)
  2731.          IF QRENAME(OldFile$, NewFile$) = 0 THEN
  2732.             PRINT "File renamed"
  2733.          ELSE
  2734.             PRINT "File not renamed"
  2735.          END IF
  2736.           .
  2737.           .
  2738.          REM Move a file
  2739.          OldFile$="\FIRSTDIR\MYFILE.TXT"+CHR$(0)
  2740.          NewFile$="\SECONDDIR\MYFILE.TXT"+CHR$(0)
  2741.          IF QRENAME(OldFile$, NewFile$) = 0 THEN
  2742.             PRINT "File renamed"
  2743.          ELSE
  2744.             PRINT "File not renamed"
  2745.          END IF
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.      File                                                                34
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.      QTREAD   -- FUNCTION
  2777.  
  2778.  
  2779.        This  function  is similar to QFREAD except instead of placing the
  2780.        record into a string buffer it will place  the record  into a user
  2781.        defined  record type.  This  allows records to be placed  directly
  2782.        into the type of record needed  and, in addition, multiple records
  2783.        can be read directly into an array of defined records.
  2784.  
  2785.        This function  requires that  the  file  be opened with QFOPEN and
  2786.        closed with QFCLOSE.   The  file handle returned by QFOPEN is used
  2787.        to  read the records.   Also required  by the call  is the segment
  2788.        address of the file buffer, the offset of the file  buffer and the
  2789.        number of  bytes to read which is usually the length of the record
  2790.        type. Upon  return,  the record will contain the  requested record
  2791.        and the actual  number of  bytes read. The RC will either  be zero
  2792.        indicating that the read was successful  or non-zero indicating an
  2793.        error.   If  the RC  is -1,  there was  an  error  in  one of  the
  2794.        parameters.  If the  RC is greater than  zero, DOS encountered  an
  2795.        error reading the file.
  2796.  
  2797.        A useful feature of this function is that block reads can be done.
  2798.        A block read is reading multiple records at a time.  If the record
  2799.        length is 50,  by setting a buffer length  to  500  will cause the
  2800.        routine to attempt to  read 10 records.  The bytes  read count can
  2801.        then be used to determine exactly how many records were read.
  2802.  
  2803.        The format of the call is as follows:
  2804.  
  2805.          RC = QTREAD(FHandle, BufSeg, BufPtr, ReadLen, BytesRead)
  2806.  
  2807.        Example:
  2808.  
  2809.          DEFINT A-Z
  2810.          DECLARE FUNCTION QTREAD% (BYVAL Handle AS INTEGER, _
  2811.                                    BYVAL BufSeg AS INTEGER, _
  2812.                                    BYVAL BufPtr AS INTEGER, _
  2813.                                    BYVAL ReadLen AS INTEGER, _
  2814.                                    BytesRead AS INTEGER)
  2815.           .
  2816.          TYPE TestType
  2817.               TstCode AS STRING * 2
  2818.               TstName  AS STRING * 34
  2819.               Balance AS LONG
  2820.          END TYPE
  2821.           .
  2822.          DIM TestRec(1 TO 100) AS TestType
  2823.           .
  2824.          REM Open file for reading
  2825.          FileName$ = "C:\DEMO\TEST.DAT"+CHR$(0)
  2826.          Faccess = 0
  2827.          RC = QFOPEN(FileName$, Faccess, FHandle)
  2828.          VSeg = VARSEG(TestRec(1))
  2829.          VPtr = VARPTR(TestRec(1))
  2830.          Rlen = LEN(TestRec(1))
  2831.  
  2832.  
  2833.      File                                                                35
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.          Olen = 0
  2843.          FOR x = 1 TO 100
  2844.              RC = QTREAD(Fhandle, VSeg, VPtr, Rlen, Olen)
  2845.              IF RC <> 0 THEN
  2846.                 PRINT "Error reading record number ", x
  2847.                 PRINT "Error code returned is ", RC
  2848.                 END
  2849.              ELSEIF Olen = 0 THEN
  2850.                 EXIT FOR
  2851.              END IF
  2852.              VPtr = VPtr + Rlen
  2853.          NEXT x
  2854.           .
  2855.          RC = QFCLOSE(FHandle)
  2856.  
  2857.  
  2858.  
  2859.      QTWRITE  -- FUNCTION
  2860.  
  2861.  
  2862.        This function is similar to QFWRITE except instead of wrinting the
  2863.        record into  a string buffer it will write the record  from a user
  2864.        defined record type.  This allows  records to be  written directly
  2865.        from the type of record needed and, in addition, multiple  records
  2866.        can be written directly from an array of defined records.
  2867.  
  2868.        This function  requires that  the file  be  opened with QFOPEN and
  2869.        closed with  QFCLOSE.  The file handle  returned by QFOPEN is used
  2870.        to write the records.  Also  required by the call  is  the segment
  2871.        address of the file  buffer, the offset of the file buffer and the
  2872.        number of bytes to write which is usually the length of the record
  2873.        type. Upon  return, the  actual  number of  bytes  written will be
  2874.        returned. The RC will either be zero indicating that the write was
  2875.        successful  or non-zero  indicating  an error.  If the  RC  is -1,
  2876.        there was an error in one of the parameters.  If the RC is greater
  2877.        than zero, DOS encountered an error writing the file.
  2878.  
  2879.        A useful feature of  this  function  is  that block writes can  be
  2880.        done. A block write is writing multiple records at a time.  If the
  2881.        record length is 50, by setting  a buffer length to 500 will cause
  2882.        the routine to attempt  to  write 10 records.  The  bytes  written
  2883.        count  can then be used to determine exactly how many records were
  2884.        written.
  2885.  
  2886.        The format of the call is as follows:
  2887.  
  2888.          RC = QTWRITE(FHandle, BufSeg, BufPtr, WriteLen, BytesWritten)
  2889.  
  2890.        Example:
  2891.  
  2892.          DEFINT A-Z
  2893.          DECLARE FUNCTION QTWRITE% (BYVAL Handle AS INTEGER, _
  2894.                                     BYVAL BufSeg AS INTEGER, _
  2895.                                     BYVAL BufPtr AS INTEGER,
  2896.                                     BYVAL WriteLen AS INTEGER, _
  2897.  
  2898.  
  2899.      File                                                                36
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.                                     BytesWritten AS INTEGER)
  2909.           .
  2910.          TYPE TestType
  2911.               TstCode AS STRING * 2
  2912.               TstName  AS STRING * 34
  2913.               Balance AS LONG
  2914.          END TYPE
  2915.           .
  2916.          DIM TestRec(1 TO 100) AS TestType
  2917.           .
  2918.          REM Open file for reading
  2919.          FileName$ = "C:\DEMO\TEST.DAT"+CHR$(0)
  2920.          Faccess = 0
  2921.          RC = QFOPEN(FileName$, Faccess, FHandle)
  2922.          VSeg = VARSEG(TestRec(1))
  2923.          Wlen = LEN(TestRec(1))
  2924.          Olen = 0
  2925.          FOR x = 1 TO RecCounter
  2926.              VPtr = VARPTR(TestRec(x))
  2927.              RC = QTWRITE(Fhandle, VSeg, VPtr, Wlen, Olen)
  2928.              IF RC <> 0 THEN
  2929.                 PRINT "Error writing record number ", x
  2930.                 PRINT "Error code returned is ", RC
  2931.                 END
  2932.              END IF
  2933.          NEXT x
  2934.           .
  2935.          RC = QFCLOSE(FHandle)
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.      File                                                                37
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.      KEYBOARD
  2975.  
  2976.  
  2977.  
  2978.      QALTKEY  -- FUNCTION
  2979.  
  2980.  
  2981.      Returns a zero to indicate that the ALT key is pressed, otherwise it
  2982.      returns a -1 to indicate that the ALT key is not pressed.
  2983.  
  2984.      The format of the call is as follows:
  2985.  
  2986.        RC = QALTKEY()
  2987.  
  2988.      Example:
  2989.  
  2990.        DEFINT A-Z
  2991.        DECLARE FUNCTION QALTKEY% ()
  2992.        WHILE INKEY$ = ""
  2993.          SELECT CASE QALTKEY
  2994.                 CASE -1
  2995.                      LOCATE 5, 2: PRINT "ALT not pressed"
  2996.                 CASE 0
  2997.                      LOCATE 5, 2: PRINT "ALT is pressed "
  2998.          END SELECT
  2999.        WEND
  3000.        END
  3001.  
  3002.  
  3003.  
  3004.      QCAPSKEY -- FUNCTION
  3005.  
  3006.  
  3007.      Returns  a  zero  to  indicate  that the CAPS LOCK  key  is pressed,
  3008.      otherwise it returns  a -1 to indicate that the CAPS LOCK key is not
  3009.      pressed.
  3010.  
  3011.      The format of the call is as follows:
  3012.  
  3013.        RC = QCAPSKEY()
  3014.  
  3015.      Example:
  3016.  
  3017.        DEFINT A-Z
  3018.        DECLARE FUNCTION QCAPSKEY% ()
  3019.        WHILE INKEY$ = ""
  3020.          SELECT CASE QCAPSKEY
  3021.                 CASE -1
  3022.                      LOCATE 5, 2: PRINT "CAPS not pressed"
  3023.                 CASE 0
  3024.                      LOCATE 5, 2: PRINT "CAPS is pressed "
  3025.          END SELECT
  3026.        WEND
  3027.        END
  3028.  
  3029.  
  3030.  
  3031.      Keyboard                                                            38
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.      QCTRLKEY -- FUNCTION
  3041.  
  3042.  
  3043.      Returns a zero to  indicate that  the CTRL key is pressed, otherwise
  3044.      it returns a -1 to indicate that the CTRL key is not pressed.
  3045.  
  3046.      The format of the call is as follows:
  3047.  
  3048.        RC = QCTRLKEY()
  3049.  
  3050.      Example:
  3051.  
  3052.        DEFINT A-Z
  3053.        DECLARE FUNCTION QCTRLKEY% ()
  3054.        WHILE INKEY$ = ""
  3055.          SELECT CASE QCTRLKEY
  3056.                 CASE -1
  3057.                      LOCATE 7, 2: PRINT "CTRL not pressed"
  3058.                 CASE 0
  3059.                      LOCATE 7, 2: PRINT "CTRL is pressed "
  3060.          END SELECT
  3061.        WEND
  3062.        END
  3063.  
  3064.  
  3065.  
  3066.      QGETKEY  -- FUNCTION
  3067.  
  3068.  
  3069.      Returns a key which is waiting in the keyboard buffer.  If the RC is
  3070.      zero then the key returned is a normal ASCII key.  If the RC  is  -1
  3071.      the  the key returned  is an extended  code.  The meanings of  these
  3072.      codes can be found in the BASIC reference manual.
  3073.  
  3074.      The format of the call is as follows:
  3075.  
  3076.        RC = QGETKEY(Char$)
  3077.  
  3078.      Example:
  3079.  
  3080.        DEFINT A-Z
  3081.        DECLARE FUNCTION QGETKEY% (Char AS STRING)
  3082.        Char$ = SPACE$(1)
  3083.        IF QGETKEY(Char$) = 0 THEN
  3084.           PRINT "Normal key "; Char$
  3085.        ELSE
  3086.           PRINT "Extended code "; Char$
  3087.        END IF
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.      Keyboard                                                            39
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.      QINKEY   -- FUNCTION
  3107.  
  3108.  
  3109.      This  function is  a  combination of  both QGETKEY and QKEYSTAT.  It
  3110.      will set  a RC to indicate if a key is waiting  and what type of key
  3111.      was pressed.  This function works very well with SELECT CASE logic.
  3112.  
  3113.      The format of the call is as follows:
  3114.  
  3115.        RC = QINKEY(Char$)
  3116.  
  3117.      Example:
  3118.  
  3119.        DEFINT A-Z
  3120.        DECLARE FUNCTION QINKEY% (Char AS STRING)
  3121.        Char$ = SPACE$(1)
  3122.        SELECT CASE QINKEY(CHAR$)
  3123.               CASE 0
  3124.                    PRINT "No key waiting."
  3125.               CASE 1
  3126.                    PRINT "Normal key "; Char$
  3127.               CASE -1
  3128.                    PRINT "Extended code "; VAL(Char$)
  3129.               CASE ELSE
  3130.                    PRINT "Error detected."
  3131.        END SELECT
  3132.  
  3133.  
  3134.  
  3135.  
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.      Keyboard                                                            40
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.      QINPUT   -- FUNCTION
  3173.  
  3174.  
  3175.      A  keyboard  input function  that has full editing capabilities.  By
  3176.      passing a verification string, each key stroke is validated as it is
  3177.      entered.  It also  returns  a RETURN CODE which indicates  which key
  3178.      was pressed to exit the input  routine.  The input string can either
  3179.      be all spaces or it can contain existing  data  to  be updated.   It
  3180.      should be  noted here,  because of  the restrictions BASIC forces on
  3181.      called ASSEMBLER programs, the size of the string must be set before
  3182.      calling  the function.  The Keys variable must be initialized with a
  3183.      number from  0 to  50 which is used to set which return keys will be
  3184.      used.  The keys  with an RC equal to or  less than the passed number
  3185.      will be  the active  return keys.  See  the next page for  the valid
  3186.      return  keys.  The color attribute  used by the program is the Aattr
  3187.      variable. The program  will reverse the color attribute that is set,
  3188.      which usually means that the input field will highlighted.
  3189.  
  3190.      The format of the call is as follows:
  3191.  
  3192.        RC = QINPUT(Ver$,InBuff$,Row,Col,Aattr,Page,Keys)
  3193.  
  3194.      Where:
  3195.  
  3196.      RC        the return code or key that was pressed to exit.
  3197.      Ver$      the string containing that valid characters.
  3198.      InBuff$   the input buffer which can be pre-populated.
  3199.      Row       the screen row to display the buffer.
  3200.      Column    the screen column to display the buffer.
  3201.      Aattr     the action video color attribute.
  3202.      Page      the video display page (Valid pages are 0-3).
  3203.      Keys      a number from 0 to 50 to indicate the valid return keys.
  3204.  
  3205.      Example:
  3206.  
  3207.        DEFINT A-Z
  3208.        DECLARE FUNCTION QINPUT% (VerStr AS STRING, _
  3209.                                  Buffer AS STRING, _
  3210.                                  BYVAL Row AS INTEGER, _
  3211.                                  BYVAL Col AS INTEGER, _
  3212.                                  BYVAL Attr AS INTEGER, _
  3213.                                  BYVAL Page AS INTEGER, _
  3214.                                  BYVAL Keys AS INTEGER)
  3215.        Fgrd    = 7
  3216.        Bkgrd   = 1
  3217.        Aattr = QATTR(Fgrd,Bkgrd)
  3218.        REM  Only accept alpha-numeric input
  3219.        Ver$    = "0123456789abcdefghijklmnopqrstuvwxyz"
  3220.        Ver$    = Ver$+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  3221.        InBuff$ = SPACE$(20)
  3222.        Row = 10  :  Col = 20  :  Page = 0  :  Keys = 8
  3223.        IF QINPUT(Ver$,InBuff$,Row,Col,Aattr,Page,Keys) > 0 THEN
  3224.           InBuff$ = RTRIM$(InBuff$)
  3225.        END IF
  3226.  
  3227.  
  3228.  
  3229.      Keyboard                                                            41
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.      The following are the valid editing keys:
  3239.  
  3240.      INSERT         Toggles the insert mode and over-type mode.
  3241.      DELETE         Delete character at cursor.
  3242.      BACKSPACE      Destructive backspace.
  3243.      LEFT ARROW     Move the cursor to the left.
  3244.      RIGHT ARROW    Move the cursor to the right.
  3245.      HOME           Move the cursor to the beginning of the field.
  3246.      END            Move the cursor to the end of the field.
  3247.      CTL-HOME       Move cursor to the start and erase the field.
  3248.      CTL-END        Erase from the cursor to the end of the field.
  3249.      CTL-BkSpace    Erase from the cursor to the start of the field.
  3250.  
  3251.      The following are the return codes returned upon exit:
  3252.  
  3253.        RC  - Key pressed                 RC  - Key pressed
  3254.  
  3255.        00  - ESC                         09  - ALT HOME
  3256.        01  - RETURN                      10  - ALT-END
  3257.        02  - CTL-RETURN               11-20  - F1 thru F10
  3258.        03  - TAB                      21-30  - SHIFT-F1 thru SHIFT-F10
  3259.        04  - SHIFT-TAB                31-40  - CTL-F1 thru CTL-F10
  3260.        05  - UP ARROW                 41-50  - ALT-F1 thru ALT-F10
  3261.        06  - DOWN ARROW
  3262.        07  - PAGE UP
  3263.        08  - PAGE DOWN
  3264.  
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.      Keyboard                                                            42
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.      QINPUTM  -- FUNCTION
  3305.  
  3306.  
  3307.      This  function works just like QINPUT but  has  the added feature of
  3308.      allowing you to supply an edit mask which makes entering information
  3309.      such  as  dates   or   social   security   numbers  look  much  more
  3310.      professional.  The  cursor  will  automatically skip  over  any mask
  3311.      characters, the user will  not  have to press the tab or arrow keys.
  3312.      The mask characters will not be returned in the buffer.   See QINPUT
  3313.      for further information  on  using  the editing functions, it  works
  3314.      just the same.
  3315.  
  3316.      The format of the call is as follows:
  3317.  
  3318.        RC = QINPUTM(Ver$,InBuff$,Mask$,Row,Col,Aattr,Page,Keys)
  3319.  
  3320.      Where:
  3321.  
  3322.      RC        the return code or key that was pressed to exit.
  3323.      Ver$      the string containing that valid characters.
  3324.      InBuff$   the input buffer which can be pre-populated.
  3325.      Mask$     the edit mask to be displayed.
  3326.      Row       the screen row to display the buffer.
  3327.      Column    the screen column to display the buffer.
  3328.      Aattr     the action video color attribute.
  3329.      Page      the video display page (Valid pages are 0-3).
  3330.      Keys      a number from 0 to 50 to indicate the valid return keys.
  3331.  
  3332.      Example:
  3333.  
  3334.        DEFINT A-Z
  3335.        DECLARE FUNCTION QINPUTM% (VerStr AS STRING, _
  3336.                                   Buffer AS STRING, _
  3337.                                   Mask AS STRING, _
  3338.                                   BYVAL Row AS INTEGER, _
  3339.                                   BYVAL Col AS INTEGER, _
  3340.                                   BYVAL Attr AS INTEGER, _
  3341.                                   BYVAL Page AS INTEGER, _
  3342.                                   BYVAL Keys AS INTEGER)
  3343.        Fgrd    = 7
  3344.        Bkgrd   = 1
  3345.        Aattr = QATTR(Fgrd,Bkgrd)
  3346.        REM  Only accept numeric input
  3347.        VerStr$ = "0123456789"
  3348.        Buffer$ = "4075551212"
  3349.        BuffMask$ = "(   )   -    "
  3350.        Row = 10  :  Col = 20  :  Page = 0  :  Keys = 8
  3351.        RC = QINPUTM(VerStr$, Buffer$, BuffMask$, Row, Col, Aattr, Page, Keys)
  3352.  
  3353.        END
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.      Keyboard                                                            43
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.      QKEYFLAG -- FUNCTION
  3371.  
  3372.  
  3373.      This  function  returns an RC  to indicate if  either the ALT, CTRL,
  3374.      LEFT SHIFT or the RIGHT SHIFT is pressed.  By adding the various key
  3375.      values together, you can check various combinations.  The key values
  3376.      are NO KEY-0, RIGHT SHIFT-1, LEFT SHIFT-2, CTRL-4 and ALT-8.
  3377.  
  3378.      The format of the call is as follows:
  3379.  
  3380.        RC = QKEYFLAG
  3381.  
  3382.      Example:
  3383.  
  3384.        DEFINT A-Z
  3385.        DECLARE FUNCTION QKEYFLAG% ()
  3386.        CLS
  3387.        WHILE INKEY$ = ""
  3388.          SELECT CASE QKEYFLAG
  3389.                 CASE 1
  3390.                      LOCATE 5, 2: PRINT "RIGHT SHIFT    "
  3391.                 CASE 15
  3392.                      LOCATE 5, 2: PRINT "R L CTRL ALT   "
  3393.          END SELECT
  3394.        WEND
  3395.        END
  3396.  
  3397.  
  3398.  
  3399.      QKEYSTAT -- FUNCTION
  3400.  
  3401.  
  3402.      This function returns an  RC to indicate if a key is waiting  in the
  3403.      keyboard buffer.   A zero indicates  no key, anything else indicates
  3404.      that a key is waiting.
  3405.  
  3406.      The format of the call is as follows:
  3407.  
  3408.        RC = QKEYSTAT
  3409.  
  3410.      Example:
  3411.  
  3412.        DEFINT A-Z
  3413.        DECLARE FUNCTION QKEYSTAT% ()
  3414.         .
  3415.        Char$ = SPACE$(1)
  3416.        IF QKEYSTAT = 0 THEN
  3417.           PRINT "No key waiting."
  3418.        ELSE
  3419.           IF QGETKEY(Char$) = 0 THEN
  3420.              PRINT "Normal key "; Char$
  3421.           ELSE
  3422.              PRINT "Extended code "; Char$
  3423.           END IF
  3424.        END IF
  3425.  
  3426.  
  3427.      Keyboard                                                            44
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.      QPOPMENU -- FUNCTION
  3437.  
  3438.  
  3439.      The  QPOPMENU function displays a menu  within a window or frame and
  3440.      obtains a selection from  the user and passes  back  an indicator of
  3441.      the  users  selection.  The function  accepts as  input  the  screen
  3442.      location where the  window should be displayed  allowing the menu to
  3443.      be  placed in a window which is a subset of the screen. The menu may
  3444.      be created  allowing selection by moving a selection bar, optionally
  3445.      each menu entry may have an action indicator which provides a faster
  3446.      selection mechanism.
  3447.  
  3448.      The QPOPMENU function is specified as follows:
  3449.  
  3450.        Slct=QPOPMENU(Cnt,VARSEG(Menu$(1)),VARPTR(Menu$(1)), _
  3451.                      Row,Col,NAttr,AAttr,HAttr,Page)
  3452.  
  3453.      The Slct variable will contain the results  of the QPOPMENU function
  3454.      when control is returned to your program. This will be the number of
  3455.      the menu array entry selected or, depending on the key pressed, zero
  3456.      if the Esc key was depressed, -1 if the left arrow was pressed or -2
  3457.      if the right arrow was pressed.
  3458.  
  3459.      The contents of the variables passed are as follows:
  3460.  
  3461.      Cnt     The number of entries  contained in the menu array which are
  3462.              to be included in the menu.
  3463.      VARSEG(Menu$(1)) A string array (Menu$) passed to QPOPMENU using the
  3464.              VARSEG/VARPTR  functions. The number (1) indicates the array
  3465.              element where the menu entries begin.
  3466.      VARPTR(Menu$(1)) A string array (Menu$) passed to QPOPMENU using the
  3467.              VARSEG/VARPTR functions. The number (1)  indicates the array
  3468.              element where the menu entries begin.
  3469.      Row     The screen row where the menu window is to start.
  3470.      Col     The screen Column where the menu window is to start.
  3471.      NAttr   The color attribute  to  be used to display normal text.  It
  3472.              is also used for the color attribute of the window frame.
  3473.      AAttr   The  color  attribute  to  be used  to  display  the  action
  3474.              character. Use 0,0 (black on black) if action characters are
  3475.              not desired.
  3476.      HAttr   The color attribute to be  used  to display the  highlighted
  3477.              menu  entry.  When  a  black  background  is  specified  the
  3478.              attribute will be reversed by the routine.
  3479.      Page    The video display page (valid pages are 0-3) to be used.
  3480.  
  3481.      Rules:
  3482.  
  3483.      1.  No  error checking is performed on the input parameters.  Errors
  3484.          in the input parameters will have unpredictable results.
  3485.  
  3486.      2.  The QPOPMENU  routine requires the Color Graphics Adapter with a
  3487.          color or monochrome (shades of gray) monitor.
  3488.  
  3489.      3.  Text placed on the screen before  this function is  called which
  3490.          is outside of the bounds of the menu itself is left undisturbed.
  3491.  
  3492.  
  3493.      Keyboard                                                            45
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.      4.  The menu is displayed  starting  at the row and column specified
  3503.          and extends down the screen using as many screen  rows as  there
  3504.          are menu entries.
  3505.  
  3506.      5.  When the action attribute specified  is not 0,0 (black on black)
  3507.          the  first character of each entry will be highlighted  with the
  3508.          action  attribute  if  there  are  36  or  fewer menu  selection
  3509.          entries.
  3510.  
  3511.      6.  The highlight  attribute is checked for a background other  than
  3512.          black. When the background  is  black the highlight attribute is
  3513.          reversed  to  create a  reverse  video  highlight  bar.  If  the
  3514.          background is not black the highlight attribute is not changed.
  3515.  
  3516.      7.  The  following keys  will be active  for the  indicated  purpose
  3517.          while the menu is displayed.
  3518.  
  3519.          Esc         Exit  the menu without a selection, 0 is returned as
  3520.                      the function result.
  3521.          Left Arrow  Exit the menu without a selection, -1 is returned as
  3522.                      the function result.
  3523.          Right Arrow Exit the menu without a selection, -2 is returned as
  3524.                      the function result.
  3525.          Enter       Selects highlighted item.
  3526.          Up          Move the highlight bar up 1  menu  entry.  Rolls  to
  3527.                      the last entry if the  highlight bar  is  already on
  3528.                      the first entry.
  3529.          Down        Move the  highlight bar down 1 menu entry.  Rolls to
  3530.                      the first entry if  the highlight bar is already  on
  3531.                      the last entry.
  3532.          Home        Move the highlight bar to the first menu entry.
  3533.          End         Move the highlight bar to the last menu entry.
  3534.          x           When  the action attribute  is  specified other than
  3535.                      0,0  (black on black) the  keys corresponding to the
  3536.                      characters highlighted by  the action attribute  may
  3537.                      be used to select the menu entry.
  3538.  
  3539.      8.  By  checking the  value  returned by QPOPMENU  for a  -1 or  -2,
  3540.          programs can use this function to create pull down menus similar
  3541.          to the menus  that  are found in the  QuickBASIC  4 environment.
  3542.          See the example below for a suggested way of accomplishing this.
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.      Keyboard                                                            46
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.      Example:
  3569.  
  3570.        DEFINT A-Z
  3571.        DECLARE FUNCTION QPOPMENU% (BYVAL Count AS INTEGER, _
  3572.                                    BYVAL MenuSeg AS INTEGER, _
  3573.                                    BYVAL MenuOff AS INTEGER, _
  3574.                                    BYVAL Row AS INTEGER, _
  3575.                                    BYVAL Col AS INTEGER, _
  3576.                                    BYVAL Norm AS INTEGER, _
  3577.                                    BYVAL Actn AS INTEGER, _
  3578.                                    BYVAL High AS INTEGER, _
  3579.                                    BYVAL Page AS INTEGER)
  3580.        OPTION BASE 1
  3581.        DIM Menu$(5)
  3582.         ...
  3583.        NAttr=QATTR(3,0)
  3584.        AAttr=QATTR(4,0)
  3585.        HAttr=QATTR(7,0)
  3586.         ...
  3587.        Menu$(1)= "A - Goto Routine One"
  3588.        Menu$(2)= "B - Goto Routine Two"
  3589.        Menu$(3)= "C - Goto Routine Three"
  3590.        Menu$(4)= "D - Goto Routine Four"
  3591.        Menu$(5)= "E - Goto Routine Five"
  3592.        Cnt = 5: Row = 3: Col = 3: Page = 0
  3593.        RC = QPOPMENU(Cnt,VARSEG(Menu$(1)),VARPTR(Menu$(1)), _
  3594.                      Row,Col,NAttr,AAttr,HAttr,Page)
  3595.        SELECT CASE RC
  3596.               CASE -2
  3597.                    GOTO NextMenu
  3598.               CASE -1
  3599.                    GOTO PrevMenu
  3600.               CASE 0
  3601.                    GOTO GetOut
  3602.               CASE 1
  3603.                    GOTO Rtn1
  3604.               CASE 2
  3605.                    GOTO Rtn2
  3606.               CASE 3
  3607.                    GOTO Rtn3
  3608.               CASE 4
  3609.                    GOTO Rtn4
  3610.               CASE 5
  3611.                    GOTO Rtn5
  3612.               CASE ELSE
  3613.                    GOTO ErrorRtn
  3614.        END SELECT
  3615.         ...
  3616.        END
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.      Keyboard                                                            47
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.      QMENU    -- FUNCTION
  3635.  
  3636.  
  3637.      The QMENU function displays a  menu and obtains a selection from the
  3638.      user  and  passes back  an  indicator  of the  users  selection. The
  3639.      function accepts as input the screen location where  the menu should
  3640.      be  displayed allowing the menu to be placed  in a window which is a
  3641.      subset of the screen. The menu may be created allowing selection  by
  3642.      moving  a selection  bar, optionally  each menu  entry may  have  an
  3643.      action indicator which provides a faster selection mechanism.
  3644.  
  3645.      The QMENU function is specified as follows:
  3646.  
  3647.        Slct=QMENU(Cnt,VARSEG(Menu$(1)),VARPTR(Menu$(1)), _
  3648.                   Row,Col,NAttr,AAttr,HAttr,Page)
  3649.  
  3650.      The Slct variable  will contain the  results  of  the QMENU function
  3651.      when  control is returned  to  your program, the number  of the menu
  3652.      array entry selected or zero if the Esc key was depressed.
  3653.  
  3654.      The contents of the variables passed are as follows:
  3655.  
  3656.      Cnt     The number of entries contained in  the menu array which are
  3657.              to be included in the menu.
  3658.      VARSEG(Menu$(1)) A  string array  (Menu$) passed to QMENU using  the
  3659.              VARSEG/VARPTR functions. The  number (1) indicates the array
  3660.              element where the menu entries begin.
  3661.      VARPTR(Menu$(1)) A  string array  (Menu$) passed to QMENU using  the
  3662.              VARSEG/VARPTR functions.  The number (1) indicates the array
  3663.              element where the menu entries begin.
  3664.      Row     The screen row where the menu display is to start.
  3665.      Col     The screen Column where the menu display is to start.
  3666.      NAttr   The color attribute to be used to display normal text.
  3667.      AAttr   The  color  attribute  to  be used  to  display  the  action
  3668.              character. Use 0,0 (black on black) if action characters are
  3669.              not desired.
  3670.      HAttr   The  color attribute to  be used to display the  highlighted
  3671.              menu  entry.  When  a  black  background  is  specified  the
  3672.              attribute will be reversed by the routine.
  3673.      Page    The video display page (valid pages are 0-3) to be used.
  3674.  
  3675.      Rules:
  3676.  
  3677.      1.  No  error checking is performed  on the input parameters. Errors
  3678.          in the input parameters will have unpredictable results.
  3679.  
  3680.      2.  The QMENU routine  requires the  Color  Graphics Adapter  with a
  3681.          color or monochrome (shades of gray) monitor.
  3682.  
  3683.      3.  Text placed on the screen before this  function is called  which
  3684.          is outside of the bounds of the menu itself is left undisturbed.
  3685.          As an  example the  QWINDOW  subroutine can  be used to create a
  3686.          window before calling this function.
  3687.  
  3688.  
  3689.  
  3690.  
  3691.      Keyboard                                                            48
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.      4.  The menu is displayed starting at the  row and column  specified
  3701.          and  extends down the screen using as many screen  rows as there
  3702.          are menu entries.
  3703.  
  3704.      5.  When the action attribute specified is not 0,0 (black  on black)
  3705.          the first character of each  entry will be highlighted with  the
  3706.          action  attribute  if  there  are  36  or  fewer menu  selection
  3707.          entries.
  3708.  
  3709.      6.  The highlight  attribute is checked for  a background other than
  3710.          black. When the  background is black the highlight attribute  is
  3711.          reversed  to  create  a  reverse  video  highlight  bar.  If the
  3712.          background is not black the highlight attribute is not changed.
  3713.  
  3714.      7.  The following  keys will be active  for  the  indicated  purpose
  3715.          while the menu is displayed.
  3716.  
  3717.          Esc     Exit the menu without a selection, 0 is returned as  the
  3718.                  function result.
  3719.          Enter   Selects highlighted item.
  3720.          Up      Move the highlight bar up 1 menu entry.
  3721.          Down    Move the highlight bar down 1 menu entry.
  3722.          Home    Move the highlight bar to the first menu entry.
  3723.          End     Move the highlight bar to the last menu entry.
  3724.          x       When the action  attribute  is specified other than  0,0
  3725.                  (black  on   black)   the  keys  corresponding  to   the
  3726.                  characters highlighted  by the  action  attribute may be
  3727.                  used to select the menu entry.
  3728.  
  3729.      Example:
  3730.  
  3731.        DEFINT A-Z
  3732.        DECLARE FUNCTION QMENU% (BYVAL Count AS INTEGER, _
  3733.                                 BYVAL MenuSeg AS INTEGER, _
  3734.                                 BYVAL MenuOff AS INTEGER, _
  3735.                                 BYVAL Row AS INTEGER, _
  3736.                                 BYVAL Col AS INTEGER, _
  3737.                                 BYVAL Norm AS INTEGER, _
  3738.                                 BYVAL Actn AS INTEGER, _
  3739.                                 BYVAL High AS INTEGER, _
  3740.                                 BYVAL Page AS INTEGER)
  3741.        OPTION BASE 1
  3742.        DIM Menu$(3)
  3743.         ...
  3744.        NAttr=QATTR(3,0)
  3745.        AAttr=QATTR(4,0)
  3746.        HAttr=QATTR(7,0)
  3747.        Menu$(1)= "A - Goto Routine One"
  3748.        Menu$(2)= "B - Goto Routine Two"
  3749.        Menu$(3)= "C - Goto Routine Three"
  3750.        Cnt = 4: Row = 3: Col = 58: Page = 0
  3751.        RC = QMENU(Cnt,VARSEG(Menu$(1)),VARPTR(Menu$(1)), _
  3752.                   Row,Col,NAttr,AAttr,HAttr,Page)
  3753.        ON RC GOTO Rtn1,Rtn2,Rtn3
  3754.         ...
  3755.  
  3756.  
  3757.      Keyboard                                                            49
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.        END
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773.  
  3774.  
  3775.  
  3776.  
  3777.  
  3778.  
  3779.  
  3780.  
  3781.  
  3782.  
  3783.  
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.      Keyboard                                                            50
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.      QMENUS   -- FUNCTION
  3833.  
  3834.  
  3835.      The QMENUS function displays a menu and obtains a selection from the
  3836.      user and passes back an indicator of the users selection. Unlike the
  3837.      QMENU function this function assumes the entire screen  is used  for
  3838.      the menu display. The function accepts as input the screen row where
  3839.      the menu is to start, the screen  column is computed  based  on  the
  3840.      longest  menu selection entry assuming  an  80 character screen. The
  3841.      displayed menu extends from the specified screen row through row 22,
  3842.      rows  23  and 24 are  not used and the 25th row is used as  a status
  3843.      line where the valid  cursor movement keys  are displayed.  The menu
  3844.      allows  selection by moving  a selection bar,  optionally each  menu
  3845.      entry may have an action indicator which provides a faster selection
  3846.      mechanism.
  3847.  
  3848.      A unique feature  of the QMENUS function allows a maximum  of 32,767
  3849.      menu  selection  entries to be  displayed. Yes, that's right  32,767
  3850.      menu selection entries. What is displayed  on the screen is a subset
  3851.      of the menu. The  cursor movement keys allow the menu to be scrolled
  3852.      in both directions, move to the next or previous screen  and move to
  3853.      the first or last screen.
  3854.  
  3855.      The QMENUS function is specified as follows:
  3856.  
  3857.        Slct=QMENUS(Cnt,VARSEG(Menu$(1)),VARPTR(Menu$(1)), _
  3858.                   Row,Col,NAttr,AAttr,HAttr,Page)
  3859.  
  3860.      The  Slct variable will contain the results  of  the QMENUS function
  3861.      when control is  returned to your program,  the  number of  the menu
  3862.      array entry selected or zero if the Esc key was depressed.
  3863.  
  3864.      The contents of the variables passed are as follows:
  3865.  
  3866.      Cnt     The number of entries contained in the menu  array which are
  3867.              to be  included in the menu. This number may range from 1 to
  3868.              32,767.
  3869.      VARSEG(Menu$(1)) A  string array  (Menu$) passed to QMENUS using the
  3870.              VARSEG/VARPTR functions. The  number (1) indicates the array
  3871.              element where the menu entries begin.
  3872.      VARPTR(Menu$(1)) A string  array (Menu$) passed to QMENUS  using the
  3873.              VARSEG/VARPTR functions. The number (1) indicates  the array
  3874.              element where the menu entries begin.
  3875.      Row     The screen row where the menu display is to start.
  3876.      NAttr   The color attribute to be used to display normal text.
  3877.      AAttr   The  color  attribute  to  be used  to  display  the  action
  3878.              character. Use 0,0 (black on black) if action characters are
  3879.              not desired.
  3880.      HAttr   The color attribute  to  be used  to display the highlighted
  3881.              menu  entry.  When  a  black  background  is  specified  the
  3882.              attribute will be reversed by the routine.
  3883.      Page    The video display page (valid pages are 0-3) to be used.
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.      Keyboard                                                            51
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.      Rules:
  3899.  
  3900.      1.  No error checking is performed  on the  input parameters. Errors
  3901.          in the input parameters will have unpredictable results.
  3902.  
  3903.      2.  The QMENUS function  requires  the Color Graphics Adapter with a
  3904.          color or monochrome (shades  of  gray) monitor. An 80x25  screen
  3905.          size is assumed.
  3906.  
  3907.      3.  Text placed on  the screen before this  function is called which
  3908.          is outside of the  bounds of the menu itself and the status line
  3909.          is left undisturbed. As an example the QWINDOW subroutine can be
  3910.          used to frame the  screen before calling this function, however,
  3911.          this frame may not use the 25th row.
  3912.  
  3913.      4.  The menu is displayed starting at the row specified  and extends
  3914.          down  the  screen to row  22. Row 25 is used as a status line to
  3915.          indicate the valid cursor movement keys.
  3916.  
  3917.      5.  When the action attribute specified is not 0,0  (black on black)
  3918.          the first character of  each entry  will be highlighted with the
  3919.          action  attribute  if  there are  36  or  fewer  menu  selection
  3920.          entries.
  3921.  
  3922.      6.  The highlight  attribute is checked for a background  other than
  3923.          black.  When the background is black  the highlight attribute is
  3924.          reversed  to  create  a  reverse  video  highlight bar.  If  the
  3925.          background is not black the highlight attribute is not changed.
  3926.  
  3927.      7.  The following  keys will be  active  for the  indicated  purpose
  3928.          while the menu is displayed.
  3929.  
  3930.          Esc     Exit the menu without a selection, 0 is returned as  the
  3931.                  function result.
  3932.          Enter   Selects highlighted item.
  3933.          Up      Move the highlight bar up 1 menu entry.
  3934.          Down    Move the highlight bar down 1 menu entry.
  3935.          PgUp    Move up 1 screen.
  3936.          PgDn    Move down 1 screen.
  3937.          Home    Move the highlight bar to the first menu entry.
  3938.          End     Move the highlight bar to the last menu entry.
  3939.          x       When the  action  attribute is specified  other than 0,0
  3940.                  (black   on  black)  the  keys  corresponding   to   the
  3941.                  characters highlighted  by the  action  attribute may be
  3942.                  used to select the menu entry.
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.      Keyboard                                                            52
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.      Example:
  3965.  
  3966.        DEFINT A-Z
  3967.        DECLARE FUNCTION QMENUS% (BYVAL Count AS INTEGER, _
  3968.                                  BYVAL MenuSeg AS INTEGER, _
  3969.                                  BYVAL MenuOff AS INTEGER, _
  3970.                                  BYVAL Row AS INTEGER, _
  3971.                                  BYVAL Norm AS INTEGER, _
  3972.                                  BYVAL Actn AS INTEGER, _
  3973.                                  BYVAL High AS INTEGER, _
  3974.                                  BYVAL Page AS INTEGER)
  3975.        OPTION BASE 1
  3976.        DIM Menu$(5)
  3977.         ...
  3978.        NAttr=QATTR(3,0)
  3979.        AAttr=QATTR(4,0)
  3980.        HAttr=QATTR(7,0)
  3981.        Menu$(1)= "Apples to Oranges"
  3982.        Menu$(2)= "Books to Comics"
  3983.         ...
  3984.        Menu$(25)= "Yet Another Entry"
  3985.        Menu$(26)= "Zebras to Horses"
  3986.        Cnt = 26
  3987.        Row = 3
  3988.        Page = 0
  3989.        RC = QMENUS(Cnt,VARSEG(Menu$(1)),VARPTR(Menu$(1)), _
  3990.                    Row,NAttr,AAttr,HAttr,Page)
  3991.        SELECT CASE RC
  3992.           CASE 1
  3993.            ...
  3994.           CASE 2
  3995.            ...
  3996.           CASE 26
  3997.            ...
  3998.        END SELECT
  3999.        END
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.      Keyboard                                                            53
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.      QNUMKEY  -- FUNCTION
  4031.  
  4032.  
  4033.      Returns a zero to indicate that the NUM LOCK key is on, otherwise it
  4034.      returns a -1 to indicate that the NUM LOCK key is not on.
  4035.  
  4036.      The format of the call is as follows:
  4037.  
  4038.        RC = QNUMKEY()
  4039.  
  4040.      Example:
  4041.  
  4042.        DEFINT A-Z
  4043.        DECLARE FUNCTION QNUMKEY% ()
  4044.        CLS
  4045.        WHILE INKEY$ = ""
  4046.          SELECT CASE QNUMKEY
  4047.                 CASE -1
  4048.                      LOCATE 5, 2: PRINT "NUM LOCK not on"
  4049.                 CASE 0
  4050.                      LOCATE 5, 2: PRINT "NUM LOCK is on "
  4051.          END SELECT
  4052.        WEND
  4053.        END
  4054.  
  4055.  
  4056.  
  4057.      QSCRLKEY -- FUNCTION
  4058.  
  4059.  
  4060.      Returns a zero to indicate that the SCROLL LOCK key is on, otherwise
  4061.      it returns a -1 to indicate that the SCROLL LOCK key is not on.
  4062.  
  4063.      The format of the call is as follows:
  4064.  
  4065.        RC = QSCRLKEY()
  4066.  
  4067.      Example:
  4068.  
  4069.        DEFINT A-Z
  4070.        DECLARE FUNCTION QSCRLKEY% ()
  4071.        CLS
  4072.        WHILE INKEY$ = ""
  4073.          SELECT CASE QSCRLKEY
  4074.                 CASE -1
  4075.                      LOCATE 5, 2: PRINT "SCROLL LOCK not on"
  4076.                 CASE 0
  4077.                      LOCATE 5, 2: PRINT "SCROLL LOCK is on "
  4078.          END SELECT
  4079.        WEND
  4080.        END
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.      Keyboard                                                            54
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.      QYESNO   -- FUNCTION
  4097.  
  4098.  
  4099.      Returns a value to indicate if the  "Y" or "N" or the  "ESC" key has
  4100.      has been pressed.  It will not return to  the main program until one
  4101.      of  the above keys has been pressed.  It will  accept both upper and
  4102.      lower case characters.  The  values returned are -1 for ESC, 0 for Y
  4103.      and 1 for N.
  4104.  
  4105.      The format of the call is as follows:
  4106.  
  4107.        RC = QYESNO()
  4108.  
  4109.      Example:
  4110.  
  4111.        DEFINT A-Z
  4112.        DECLARE FUNCTION QYESNO% ()
  4113.        CLS
  4114.        PRINT "Press (Y)es or (N)o --> ";
  4115.        SELECT CASE QYESNO
  4116.               CASE -1
  4117.                    PRINT "ESC was pressed"
  4118.               CASE 0
  4119.                    PRINT "Y was pressed"
  4120.               CASE 1
  4121.                    PRINT "N was pressed"
  4122.        END SELECT
  4123.        END
  4124.  
  4125.  
  4126.  
  4127.  
  4128.  
  4129.  
  4130.  
  4131.  
  4132.  
  4133.  
  4134.  
  4135.  
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.      Keyboard                                                            55
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.      MISCELLANEOUS
  4163.  
  4164.  
  4165.  
  4166.      QALARM   -- SUB
  4167.  
  4168.  
  4169.      Produces a pulsating alarm tone.
  4170.  
  4171.      The format of the call is as follows:
  4172.  
  4173.        QALARM
  4174.  
  4175.      Example:
  4176.  
  4177.        DEFINT A-Z
  4178.        DECLARE SUB QALARM ()
  4179.        QALARM
  4180.  
  4181.  
  4182.  
  4183.      QARGC QARGV -- FUNCTION
  4184.  
  4185.  
  4186.      QARGC returns  the number of command line parameters  used to envoke
  4187.      the  program.   This  value  can  be  tested  to  determine  if  any
  4188.      parameters  were passed  to  the  program.  This  routines  has been
  4189.      optimized for multiple executions.
  4190.  
  4191.      QARGV  returns  the space delimited  parameters used  to  invoke the
  4192.      program.  The  parameters are placed into individual  elements  much
  4193.      like a  BASIC array.   The zero element, QARGV(0), returns the fully
  4194.      qualified program name, including the drive letter, of the executing
  4195.      program in version 3.x of DOS.  Prior versions return a null string.
  4196.      Use QARGC to determine the number of command line parameters.
  4197.  
  4198.      The format of the calls are as follows:
  4199.  
  4200.        Parms = QARGC
  4201.        Parm$ = QARGV(Parms)
  4202.  
  4203.      Example:
  4204.  
  4205.        DEFINT A-Z
  4206.        DECLARE FUNCTION QARGC% ()
  4207.        DECLARE FUNCTION QARGV$ (ParmNumber AS INTEGER)
  4208.        IF QARGC > 0 THEN
  4209.           FOR X = 1 TO QARGC
  4210.               PRINT QARGV(X)
  4211.           NEXT X
  4212.        END IF
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.      Miscellaneous                                                       56
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.      QCAPSOFF QCAPSON -- SUB
  4229.  
  4230.  
  4231.      This  routine will  enable  or  disable the  CAPS LOCK  key  on  the
  4232.      keyboard.   This will force  all  input  to be in upper case without
  4233.      having  to press the  shift key.   The normal functions can still be
  4234.      used by pressing the shift key and then the appropriate key.
  4235.  
  4236.      The format of the call is as follows:
  4237.  
  4238.        QCAPSOFF
  4239.        QCAPSON
  4240.  
  4241.      Example:
  4242.  
  4243.        DEFINT A-Z
  4244.        DECLARE SUB QCAPSOFF ()
  4245.        DECLARE SUB QCAPSON ()
  4246.        QCAPSON
  4247.         .
  4248.        QCAPSOFF
  4249.  
  4250.  
  4251.  
  4252.  
  4253.  
  4254.  
  4255.  
  4256.  
  4257.  
  4258.  
  4259.  
  4260.  
  4261.  
  4262.  
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.      Miscellaneous                                                       57
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.      QCLOCK   -- SUB
  4295.  
  4296.  
  4297.      Display a running clock on the screen.  This is a very nice touch on
  4298.      menu  and  update  screens.  The clock  can be turned on and off  by
  4299.      flipping the "switch" (1  = on,  0 = off).  The routine  can also be
  4300.      called  again  to move  the  location of the clock without having to
  4301.      first turn it off.
  4302.  
  4303.      The format of the call is as follows:
  4304.  
  4305.        QCLOCK Row, Col, NAttr, Page, Switch
  4306.  
  4307.      Example:
  4308.  
  4309.        DEFINT A-Z
  4310.        DECLARE SUB QCLOCK (BYVAL Row AS INTEGER, _
  4311.                            BYVAL Col AS INTEGER, _
  4312.                            BYVAL NAttr AS INTEGER, _
  4313.                            BYVAL Page AS INTEGER, _
  4314.                            BYVAL Switch AS INTEGER)
  4315.        REM Turn the clock on
  4316.        Fgrd=5 : Bkgrd=7
  4317.        NAttr = QATTR(Fgrd,Bkgrd)
  4318.        Row    = 2
  4319.        Col    = 70
  4320.        Switch = 1
  4321.        Page   = 0
  4322.        QCLOCK Row, Col, NAttr, Page, Switch
  4323.        REM Turn the clock off
  4324.        Switch = 0
  4325.        QCLOCK Row, Col, NAttr, Page, Switch
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.      Miscellaneous                                                       58
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.      QCMDLEN  -- FUNCTION
  4361.  
  4362.  
  4363.      Returns the length of the command line used  to  envoke the program.
  4364.      This  function  is helpful  in  setting  the  length  of the  string
  4365.      variable needed  when using QCMDLINE.  If there  is no  command line
  4366.      information, then zero is returned.
  4367.  
  4368.      The format of the call is as follows:
  4369.  
  4370.        RC = QCMDLEN
  4371.  
  4372.      Example:
  4373.  
  4374.        DEFINT A-Z
  4375.        DECLARE FUNCTION QCMDLEN% ()
  4376.        DECLARE FUNCTION QCMDLINE% (CmdLine AS STRING)
  4377.        IF QCMDLEN = 0 THEN
  4378.           PRINT "No command line parameters."
  4379.        ELSE
  4380.           CmdLine$ = Space$(QCMDLEN)
  4381.           RC = QCMDLINE(CmdLine$)
  4382.           PRINT "Command line is " CmdLine$
  4383.        END IF
  4384.  
  4385.  
  4386.  
  4387.      QCMDLINE -- FUNCTION
  4388.  
  4389.  
  4390.      Returns the command line used  to invoke the program.  This function
  4391.      works like  the COMMAND$ function  except  it does  not  convert all
  4392.      letters to uppercase.  You do not have to pre-set the return string,
  4393.      one of the  correct size  will be returned.  A null string  will  be
  4394.      returned  it there aren't any characters passed.  This function does
  4395.      not  work  in  the  editor environment because  it will  return  the
  4396.      command line used to invoke QuickBasic.
  4397.  
  4398.      The format of the call is as follows:
  4399.  
  4400.        CmdLine$ = QCMDLINE
  4401.  
  4402.      Example:
  4403.  
  4404.        DEFINT A-Z
  4405.        DECLARE FUNCTION QCMDLEN% ()
  4406.        DECLARE FUNCTION QCMDLINE$ ()
  4407.        IF QCMDLEN = 0 THEN
  4408.           PRINT "No command line parameters."
  4409.        ELSE
  4410.           CmdLine$ = QCMDLINE
  4411.           PRINT "Command line is " CmdLine$
  4412.        END IF
  4413.  
  4414.  
  4415.  
  4416.  
  4417.      Miscellaneous                                                       59
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.      QCRCCHK QCRCSET -- FUNCTION
  4427.  
  4428.  
  4429.      These  functions   will  either  calculate   and  set  the  cyclical
  4430.      redundancy check (CRC) value for a record or check the validity if a
  4431.      record with  the CRC already set.  These functions  will return a RC
  4432.      which will be zero if OK or -1 on an error.
  4433.  
  4434.      The format of the call is as follows:
  4435.  
  4436.        RC = QCRCCHK(Rec$)
  4437.        RC = QCRCSET(Rec$)
  4438.  
  4439.      Example:
  4440.  
  4441.        DEFINT A-Z
  4442.        DECLARE FUNCTION QCRCCHK% (Record AS STRING)
  4443.        DECLARE FUNCTION QCRCSET% (Record AS STRING)
  4444.        REM Sending a record
  4445.        Rec$ = Rec$+STRING$(2,0)
  4446.        IF QCRCSET(Rec$) = 0 THEN
  4447.           Send the record
  4448.        ELSE
  4449.           Error computing the CRC
  4450.        END IF
  4451.         .
  4452.        REM Receiving a record
  4453.        IF QCRCCHK(Rec$) = 0 THEN
  4454.           Rec$ = LEFT$(Rec$,LEN(Rec$)-2)
  4455.        ELSE
  4456.           Error in CRC, request a resend
  4457.        END IF
  4458.  
  4459.  
  4460.  
  4461.      QDOSVER  -- SUB
  4462.  
  4463.  
  4464.      Retrieve the MS-DOS version.   The major version is returned in  the
  4465.      first parm and the minor version in the second parm.
  4466.  
  4467.      The format of the call is as follows:
  4468.  
  4469.        QDOSVER Lparm, Rparm
  4470.  
  4471.      Example:
  4472.  
  4473.        DEFINT A-Z
  4474.        DECLARE SUB QDOSVER (Major AS INTEGER, _
  4475.                             Minor AS INTEGER)
  4476.        QDOSVER Lparm, Rparm
  4477.        PRINT Lparm, Rparm
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.      Miscellaneous                                                       60
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.      QEMSSIZE -- SUB
  4493.  
  4494.  
  4495.      Returns both  the total and free amounts of memory in kilobytes that
  4496.      is  available on an EMS board.  If no  board is installed or the EMS
  4497.      driver is not loaded, it will return -1 for both.
  4498.  
  4499.      The format of the call is as follows:
  4500.  
  4501.        QEMSSIZE Total, Free
  4502.  
  4503.      Example:
  4504.  
  4505.        DEFINT A-Z
  4506.        DECLARE SUB QEMSSIZE (Total AS INTEGER, _
  4507.                              Free AS INTEGER)
  4508.        QEMSSIZE Total, Free
  4509.        IF Total > 0 THEN
  4510.           PRINT "Total is" Total " Free is" Free
  4511.        ELSE
  4512.           PRINT "EMS is not available."
  4513.        END IF
  4514.  
  4515.  
  4516.  
  4517.      QEMSEXIST -- FUNCTION
  4518.  
  4519.  
  4520.      Returns a return  code indicating if  an  EMS  board  and driver  is
  4521.      installed.  If either is unavailable it will  return -1 otherwise it
  4522.      returns a zero.
  4523.  
  4524.      The format of the call is as follows:
  4525.  
  4526.        RC = QEMSEXIST()
  4527.  
  4528.      Example:
  4529.  
  4530.        DEFINT A-Z
  4531.        DECLARE FUNCTION QEMSSIZE% ()
  4532.        IF QEMSEXIST() = 0 THEN
  4533.           PRINT "EMS is available"
  4534.        ELSE
  4535.           PRINT "EMS is not available."
  4536.        END IF
  4537.  
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.      Miscellaneous                                                       61
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.      QEQUIPMENT -- SUB
  4559.  
  4560.  
  4561.      Returns information on the hardware  configuration of  the computer.
  4562.      The information returned is  the memory installed  in kilobytes, the
  4563.      number of parallel ports (0-3), the number of serial ports (0-7) and
  4564.      the number of game ports (0-1).
  4565.  
  4566.      The format of the call is as follows:
  4567.  
  4568.        QEQUIPMENT Memory, Parallel, Serial, Game
  4569.  
  4570.      Example:
  4571.  
  4572.        DEFINT A-Z
  4573.        DECLARE SUB QEQUIPMENT (Memory AS INTEGER, _
  4574.                                Parallel AS INTEGER, _
  4575.                                Serial AS INTEGER, _
  4576.                                Game AS INTEGER)
  4577.        QEQUIPMENT Memory, Parallel, Serial, Game
  4578.        PRINT Memory, Parallel, Serial, Game
  4579.  
  4580.  
  4581.  
  4582.      QEXIT    -- SUB
  4583.  
  4584.  
  4585.      This routine provides a method of letting you set the DOS errorlevel
  4586.      and exiting  your program.   There may be cases where it  may  cause
  4587.      some problems so use it with care.  This routine is used instead  of
  4588.      the BASIC commands "END" or "SYSTEM".  The errorlevel can  be set to
  4589.      any value between 0  and  255.  You must also be sure that any  open
  4590.      files  are closed before  calling this routine  because it does  not
  4591.      return, it  jumps straight  to DOS.  This routine can now  be called
  4592.      from  the  programming environment, it basically will perform a nop,
  4593.      you should include a BASIC "END" or "SYSTEM" on the next line.
  4594.  
  4595.      The format of the call is as follows:
  4596.  
  4597.        QEXIT ErrorLevel
  4598.  
  4599.      Example:
  4600.  
  4601.        DEFINT A-Z
  4602.        DECLARE SUB QEXIT (ErrorLevel AS INTEGER)
  4603.         .
  4604.        ErrorExit:
  4605.        CLOSE
  4606.        ErrorLevel = 16
  4607.        QEXIT ErrorLevel
  4608.        END
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.  
  4615.      Miscellaneous                                                       62
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.      QINPORT  -- FUNCTION
  4625.  
  4626.  
  4627.      This function works just like  the BASIC  INP function except it  is
  4628.      slightly faster.  The port must be a number between 0 and 65,535 and
  4629.      can be either and integer or  in  BASIC  HEX notation.  The function
  4630.      will return the value that was read from the port requested.
  4631.  
  4632.      The format of the call is as follows:
  4633.  
  4634.        PortVal = QINPORT(&H6A)
  4635.  
  4636.      Example:
  4637.  
  4638.        DEFINT A-Z
  4639.        DECLARE FUNCTION QINPORT% (BYVAL Port AS INTEGER)
  4640.         .
  4641.         .
  4642.        PortVal = QINPORT(&H6A)
  4643.        PRINT PortVal
  4644.  
  4645.  
  4646.  
  4647.      QMININT QMAXINT -- FUNCTION
  4648.  
  4649.  
  4650.      These  functions will return either  the smaller of two integers for
  4651.      QMININT or the larger of two integers for QMAXINT.   This will allow
  4652.      numbers to be selected with a minimum of code.
  4653.  
  4654.      The format of the call is as follows:
  4655.  
  4656.        NewMin = QMININT(Number1, Number2)
  4657.        NewMax = QMAXINT(Number1, Number2)
  4658.  
  4659.      Example:
  4660.  
  4661.        DEFINT A-Z
  4662.        DECLARE FUNCTION QMININT% (BYVAL NUM1 AS INTEGER, BYVAL NUM1 AS INTEGER)
  4663.        DECLARE FUNCTION QMAXINT% (BYVAL NUM1 AS INTEGER, BYVAL NUM1 AS INTEGER)
  4664.         .
  4665.        NewMin = QMININT(600, 682)
  4666.        NewMax = QMAXINT(600, 682)
  4667.        PRINT "The smaller number is " NewMin
  4668.        PRINT "The larger number is " NewMax
  4669.        END
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.      Miscellaneous                                                       63
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.      QMINLONG QMAXLONG -- FUNCTION
  4691.  
  4692.  
  4693.      These functions will return either the  smaller of two long integers
  4694.      for QMININT  or  the  larger of two long  integers for QMAXINT. This
  4695.      will allow numbers to be selected with a minimum of code.
  4696.  
  4697.      The format of the call is as follows:
  4698.  
  4699.        NewMin = QMINLONG(Number1, Number2)
  4700.        NewMax = QMAXLONG(Number1, Number2)
  4701.  
  4702.      Example:
  4703.  
  4704.        DEFLONG A-Z
  4705.        DECLARE FUNCTION QMINLONG& (BYVAL NUM1 AS LONG, BYVAL NUM1 AS LONG)
  4706.        DECLARE FUNCTION QMAXLONG& (BYVAL NUM1 AS LONG, BYVAL NUM1 AS LONG)
  4707.         .
  4708.        NewMin = QMININT(600000, 682000)
  4709.        NewMax = QMAXINT(600000, 682000)
  4710.        PRINT "The smaller number is " NewMin
  4711.        PRINT "The larger number is " NewMax
  4712.        END
  4713.  
  4714.  
  4715.  
  4716.      QNUMLOCKOFF QNUMLOCKON -- SUB
  4717.  
  4718.  
  4719.      This routine will enable or disable the NUMLOCK key on the keyboard.
  4720.      This  will allow  the numeric keypad  to  be used without  having to
  4721.      press  the shift key.   The normal functions can still  be  used  by
  4722.      pressing the shift key and then the appropriate key.
  4723.  
  4724.      The format of the call is as follows:
  4725.  
  4726.        QNUMLOCKOFF
  4727.        QNUMLOCKON
  4728.  
  4729.      Example:
  4730.  
  4731.        DEFINT A-Z
  4732.        DECLARE SUB QNUMLOCKOFF ()
  4733.        DECLARE SUB QNUMLOCKON ()
  4734.        QNUMLOCKON
  4735.         .
  4736.        QNUMLOCKOFF
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.      Miscellaneous                                                       64
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.      QPRINTER -- FUNCTION
  4757.  
  4758.  
  4759.      Check to  see if  the first printer  device is active or on.  The RC
  4760.      will be 0  if it is online or -1 if it is not.   Care must be  taken
  4761.      when using this function because  some print spoolers  may return  0
  4762.      when the printer is actually offline.
  4763.  
  4764.      The format of the call is as follows:
  4765.  
  4766.        RC = QPRINTER
  4767.  
  4768.      Example:
  4769.  
  4770.        DEFINT A-Z
  4771.        DECLARE FUNCTION QPRINTER% ()
  4772.         .
  4773.        IF QPRINTER = 0 THEN
  4774.           PRINT "Printer is online"
  4775.        ELSE
  4776.           PRINT "Printer is offline"
  4777.        END IF
  4778.  
  4779.  
  4780.  
  4781.      QPRTSCRN -- SUB
  4782.  
  4783.  
  4784.      Prints  the  current screen display  to the current  printer device.
  4785.      This  routine functions exactly the same as pressing the Shift-PrtSc
  4786.      keys from the keyboard.
  4787.  
  4788.      The format of the call is as follows:
  4789.  
  4790.        QPRTSCRN
  4791.  
  4792.      Example:
  4793.  
  4794.        DEFINT A-Z
  4795.        DECLARE SUB QPRTSCRN ()
  4796.        QPRTSCRN
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.      Miscellaneous                                                       65
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.      QPRTSCRNOFF QPRTSCRNON -- SUB
  4823.  
  4824.  
  4825.      These  routines will  enable  or  disable  the  PRTSCRN key  on  the
  4826.      keyboard.   This will prevent anyone from  accidently  pressing  the
  4827.      wrong key while the program is executing.
  4828.  
  4829.      The format of the call is as follows:
  4830.  
  4831.        QPRTSCRNOFF
  4832.        QPRTSCRNON
  4833.  
  4834.      Example:
  4835.  
  4836.        DECLARE SUB QPRTSCRNOFF ()
  4837.        DECLARE SUB QPRTSCRNON ()
  4838.        QPRTSCRNOFF
  4839.         .
  4840.        QPRTSCRNON
  4841.  
  4842.  
  4843.  
  4844.      QPAUSE   -- SUB
  4845.  
  4846.  
  4847.      Pause for a given number of seconds.  It uses the  system  clock and
  4848.      will pause for the same amount of time regardless of the CPU used.
  4849.  
  4850.      The format of the call is as follows:
  4851.  
  4852.        QPAUSE Seconds
  4853.  
  4854.      Example:
  4855.  
  4856.        DEFINT A-Z
  4857.        DECLARE SUB QPAUSE (BYVAL Seconds AS INTEGER)
  4858.        Seconds = 15
  4859.        QPAUSE Seconds
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.  
  4879.      Miscellaneous                                                       66
  4880.  
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.      QPAUSE18 -- SUB
  4889.  
  4890.  
  4891.      Pause for a  given number of eighteenths  of a  second.  The  actual
  4892.      amount may vary depending on the PC that you are using.
  4893.  
  4894.      The format of the call is as follows:
  4895.  
  4896.        QPAUSE18 Count
  4897.  
  4898.      Example:
  4899.  
  4900.        DEFINT A-Z
  4901.        DECLARE SUB QPAUSE18 (BYVAL Count AS INTEGER)
  4902.        REM Pause for 1/2 second.
  4903.        Count = 9
  4904.        QPAUSE18 Count
  4905.  
  4906.  
  4907.  
  4908.      QREBOOT  -- SUB
  4909.  
  4910.  
  4911.      Forces the  system to  do an immediate reboot.  This program can  be
  4912.      useful  in programs that change the CONFIG.SYS  file  which requires
  4913.      that the system be rebooted to take effect.
  4914.  
  4915.      The format of the call is as follows:
  4916.  
  4917.        QREBOOT
  4918.  
  4919.      Example:
  4920.  
  4921.        DEFINT A-Z
  4922.        DECLARE SUB QREBOOT ()
  4923.        REM Replace the config.sys file
  4924.        RC = QCOPYFIL("CONFIG.NEW" + CHR$(0), "CONFIG.SYS + CHR$(0))
  4925.        QREBOOT
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.      Miscellaneous                                                       67
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.      QSHIFTIL QSHIFTIR -- FUNCTION
  4955.  
  4956.  
  4957.      These  functions will  take  an  integer  and  shift  the  bits  the
  4958.      requested number of  bits either left or  right and return  the  new
  4959.      number.  This will  increase or decrease the number by  the power of
  4960.      two.
  4961.  
  4962.      The format of the call is as follows:
  4963.  
  4964.        Num1 = QSHIFTIL(Number, 1)
  4965.        Num2 = QSHIFTIR(Number, 1)
  4966.  
  4967.      Example:
  4968.  
  4969.        DEFINT A-Z
  4970.        DECLARE FUNCTION QSHIFTIL% (BYVAL Number AS INTEGER, _
  4971.                                    BYVAL Shift AS INTEGER)
  4972.        DECLARE FUNCTION QSHIFTIR% (BYVAL Number AS INTEGER, _
  4973.                                    BYVAL Shift AS INTEGER)
  4974.         .
  4975.        Num1 = QSHIFTIL(5,1)
  4976.        Num2 = QSHIFTIL(10,1)
  4977.        PRINT Num1, Num2
  4978.  
  4979.  
  4980.  
  4981.      QSHIFTLL QSHIFTLR -- FUNCTION
  4982.  
  4983.  
  4984.      These functions  will  take  a long integer  and shift the bits  the
  4985.      requested  number of bits either  left or right  and  return the new
  4986.      number.   This will increase or decrease  the number by the power of
  4987.      two.
  4988.  
  4989.      The format of the call is as follows:
  4990.  
  4991.        Num1 = QSHIFTLL(Number, 1)
  4992.        Num2 = QSHIFTLR(Number, 1)
  4993.  
  4994.      Example:
  4995.  
  4996.        DEFLONG A-Z
  4997.        DECLARE FUNCTION QSHIFTIL& (BYVAL Number AS LONG, _
  4998.                                    BYVAL Shift AS INTEGER)
  4999.        DECLARE FUNCTION QSHIFTIR& (BYVAL Number AS LONG, _
  5000.                                    BYVAL Shift AS INTEGER)
  5001.         .
  5002.        Num1 = QSHIFTLL(65536,1)
  5003.        Num2 = QSHIFTLL(262144,1)
  5004.        PRINT Num1, Num2
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.      Miscellaneous                                                       68
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.      QSCROLLOFF QSCROLLON -- SUB
  5021.  
  5022.  
  5023.      This  routine  will enable  or disable  the  SCROLL  LOCK key on the
  5024.      keyboard.
  5025.  
  5026.      The format of the call is as follows:
  5027.  
  5028.        QSCROLLOFF
  5029.        QSCROLLON
  5030.  
  5031.      Example:
  5032.  
  5033.        DEFINT A-Z
  5034.        DECLARE SUB QSCROLLOFF ()
  5035.        DECLARE SUB QSCROLLON ()
  5036.        QSCROLLON
  5037.         .
  5038.        QSCROLLOFF
  5039.  
  5040.  
  5041.  
  5042.      QTIME    -- SUB
  5043.  
  5044.  
  5045.      Returns  4 integers which  contain the  current  hours,  minutes and
  5046.      seconds of  the  day  as  well as the total number  of seconds since
  5047.      midnight.
  5048.  
  5049.      The format of the call is as follows:
  5050.  
  5051.        QTIME Hours, Minutes, Seconds, TotSeconds
  5052.  
  5053.      Example:
  5054.  
  5055.        DEFINT A-Z
  5056.        DECLARE SUB QTIME (Hours AS INTEGER, _
  5057.                           Minutes AS INTEGER, _
  5058.                           Seconds AS INTEGER, _
  5059.                           TotSeconds AS LONG)
  5060.         .
  5061.        QTIME Hours, Minutes, Seconds, TotSeconds
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  
  5067.  
  5068.  
  5069.  
  5070.  
  5071.  
  5072.  
  5073.  
  5074.  
  5075.  
  5076.  
  5077.      Miscellaneous                                                       69
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.      QTEMPC   -- FUNCTION
  5087.  
  5088.  
  5089.      This function  will convert the  inputed fahrenheit temperature  and
  5090.      convert it into centigrade.
  5091.  
  5092.      The format of the call is as follows:
  5093.  
  5094.        TempC = QTEMPC(TempF);
  5095.  
  5096.      Example:
  5097.  
  5098.        DEFINT A-Z
  5099.        DECLARE FUNCTION QTEMPC% (BYVAL Fahrenheit AS INTEGER)
  5100.        FOR N1 = 32 TO 212
  5101.            PRINT QTEMPC(N1);
  5102.        NEXT N1
  5103.        END
  5104.  
  5105.  
  5106.  
  5107.      QTEMPF   -- FUNCTION
  5108.  
  5109.  
  5110.      This function will  convert the  inputed centigrade  temperature and
  5111.      convert it into fahrenheit.
  5112.  
  5113.      The format of the call is as follows:
  5114.  
  5115.        TempF = QTEMPF(TempC);
  5116.  
  5117.      Example:
  5118.  
  5119.        DEFINT A-Z
  5120.        DECLARE FUNCTION QTEMPF% (BYVAL Fahrenheit AS INTEGER)
  5121.        FOR N1 = 0 TO 100
  5122.            PRINT QTEMPF(N1);
  5123.        NEXT N1
  5124.        END
  5125.  
  5126.  
  5127.  
  5128.  
  5129.  
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.      Miscellaneous                                                       70
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.      QVERIFY  -- FUNCTION
  5153.  
  5154.  
  5155.      Returns an integer which  indicates if  the DOS write verify flag is
  5156.      on or off.  If the value is zero then the verify flag is turned off.
  5157.      If the value is one then the flag is turned on.
  5158.  
  5159.      The format of the call is as follows:
  5160.  
  5161.        Flag = QVERIFY
  5162.  
  5163.      Example:
  5164.  
  5165.        DEFINT A-Z
  5166.        DECLARE FUNCTION QVERIFY% ()
  5167.         .
  5168.        PRINT "The write verify flag is ";
  5169.        IF QVERIFY = 0 THEN
  5170.           PRINT "OFF"
  5171.        ELSE
  5172.           PRINT "ON"
  5173.        END IF
  5174.  
  5175.  
  5176.  
  5177.      QVERIFYOFF QVERIFYON -- SUB
  5178.  
  5179.  
  5180.      These subroutines will either turn the verify flag on or off. If the
  5181.      verify flag is turned on, writing to files will take longer.
  5182.  
  5183.      The format of the call is as follows:
  5184.  
  5185.        QVERIFYOFF
  5186.        QVERIFYON
  5187.  
  5188.      Example:
  5189.  
  5190.        DEFINT A-Z
  5191.        DECLARE SUB QVERIFYOFF()
  5192.        DECLARE SUB QVERIFYON()
  5193.        DECLARE FUNCTION QVERIFY% ()
  5194.         .
  5195.        CLS
  5196.        PRINT QVERIFY
  5197.        QVERIFYON
  5198.        PRINT QVERIFY
  5199.        QVERIFYOFF
  5200.        PRINT QVERIFY
  5201.        END
  5202.  
  5203.  
  5204.  
  5205.  
  5206.  
  5207.  
  5208.  
  5209.      Miscellaneous                                                       71
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.      Q8087    -- FUNCTION
  5219.  
  5220.  
  5221.      Returns an integer which indicates if an 80x87  math coprocessor  is
  5222.      present.  If  the value  is  zero then  a coprocessor is present.  A
  5223.      value of -1 is returned if a coprocessor is not present.
  5224.  
  5225.      The format of the call is as follows:
  5226.  
  5227.        Flag = Q8087
  5228.  
  5229.      Example:
  5230.  
  5231.        DEFINT A-Z
  5232.        DECLARE FUNCTION Q8087% ()
  5233.        IF Q8087 = 0 THEN
  5234.            PRINT "Co-processor is present"
  5235.        ELSE
  5236.            PRINT "Co-processor is not present"
  5237.        END IF
  5238.        END
  5239.  
  5240.  
  5241.  
  5242.  
  5243.  
  5244.  
  5245.  
  5246.  
  5247.  
  5248.  
  5249.  
  5250.  
  5251.  
  5252.  
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.      Miscellaneous                                                       72
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.      STRING
  5285.  
  5286.  
  5287.  
  5288.      QCAPIT   -- SUB
  5289.  
  5290.  
  5291.      This routine will take an input string and change the first character
  5292.      to upper case and the remainder of the string will be changed to lower
  5293.      case.  If the second character of the string is an apostrophe ('), then
  5294.      the third character will also be converted to an upper case character.
  5295.  
  5296.      The format of the call is as follows:
  5297.  
  5298.        QCAPIT TstStr$
  5299.  
  5300.      Example:
  5301.  
  5302.        DEFINT A-Z
  5303.        DECLARE SUB QCAPIT (StringName AS STRING)
  5304.        TstStr$="harold"
  5305.        QCAPIT TstStr$
  5306.        PRINT TstStr$
  5307.         .
  5308.        TstStr$="o'brian"
  5309.        QCAPIT TstStr$
  5310.        PRINT TstStr$
  5311.        END
  5312.  
  5313.  
  5314.  
  5315.      QCENTER  -- SUB
  5316.  
  5317.  
  5318.      This routine will take an input string  that has been  padded with
  5319.      spaces and center the test.  It  does not matter if the padding is
  5320.      on  the left or  the  right of  the  text and  the  text can  have
  5321.      multiple words.  The way that this routine works  is to first left
  5322.      justify all text and then to center the text.
  5323.  
  5324.      The format of the call is as follows:
  5325.  
  5326.        QCENTER TstStr$
  5327.  
  5328.      Example:
  5329.  
  5330.        DEFINT A-Z
  5331.        DECLARE SUB QCENTER (StringName AS STRING)
  5332.        TstStr$ = "Harold Thomson" + SPACE$(30)
  5333.        QCENTER TstStr$
  5334.        PRINT TstStr$
  5335.        END
  5336.  
  5337.  
  5338.  
  5339.  
  5340.  
  5341.      String                                                              73
  5342.  
  5343.  
  5344.  
  5345.  
  5346.  
  5347.  
  5348.  
  5349.  
  5350.      QCHARTYP -- FUNCTION
  5351.  
  5352.  
  5353.      This  function is  used to determine  if  an input string contains
  5354.      valid characters which are inputed to the function via a string of
  5355.      valid characters.  If the inputed characters are valid, a zero (0)
  5356.      is returned otherwise the position of the first invalid characters
  5357.      is returned. If either string is null ("") then a -1 is returned.
  5358.  
  5359.      The format of the call is as follows:
  5360.  
  5361.        RC = QCHARTYP(TstStr$, ValStr$)
  5362.  
  5363.      Example:
  5364.  
  5365.        DEFINT A-Z
  5366.        DECLARE FUNCTION QCHARTYP% (TstStr AS STRING, ValStr AS STRING)
  5367.        TstStr$="abbc2254621"
  5368.        ValStr$="abcdefgABCDEFG12345"
  5369.        IF QCHARTYP(TstStr$, ValStr$) = 0 THEN
  5370.           PRINT "The string is valid"
  5371.        ELSE
  5372.           PRINT "The string is invalid"
  5373.        END
  5374.  
  5375.  
  5376.  
  5377.      QDELIM   -- FUNCTION
  5378.  
  5379.  
  5380.      Returns  the  n'th  word  in  a comma  delimited  string.  If  the
  5381.      requested word is null (,,) then a null string is returned.
  5382.  
  5383.      The format of the call is as follows:
  5384.  
  5385.        NewStr$ = QDELIM(TstStr$, Index)
  5386.  
  5387.      Example:
  5388.  
  5389.        DEFINT A-Z
  5390.        DECLARE FUNCTION QDELIM$ (StringName AS STRING,
  5391.                                  BYVAL Indx AS INTEGER)
  5392.        TstStr$="This,,string,contains,five,words"
  5393.        Index = 5
  5394.        NewStr$ = QDELIM(TstStr$, Indx)
  5395.        IF NewStr$ <> "" THEN
  5396.           PRINT "The fifth word of the string is " NewStr$
  5397.        ELSE
  5398.           PRINT "Error in QDELIM"
  5399.        END
  5400.  
  5401.  
  5402.  
  5403.  
  5404.  
  5405.  
  5406.  
  5407.      String                                                              74
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416.      QEXTRACT -- FUNCTION
  5417.  
  5418.  
  5419.      Returns the  n'th word from a string based upon a  delimiter which
  5420.      is  passed in the call. A null string is returned if  an error  is
  5421.      encountered.
  5422.  
  5423.      The format of the call is as follows:
  5424.  
  5425.        NewString$ = QEXTRACT(TstStr$, Delim$, Index)
  5426.  
  5427.      Example:
  5428.  
  5429.        DEFINT A-Z
  5430.        DECLARE FUNCTION QEXTRACT$ (StringName AS STRING, _
  5431.                                    Delim AS STRING, _
  5432.                                    BYVAL Index AS INTEGER)
  5433.        TstStr$="This@string@contains@five@words"
  5434.        Index = 4
  5435.        Delim$ = "@"
  5436.        NewStr$ = QEXTRACT(TstStr$, Delim$, Index)
  5437.        IF NewStr$ <> "" THEN
  5438.           PRINT "The fourth word of the string is " NewStr$
  5439.        ELSE
  5440.           PRINT "Error in QEXTRACT"
  5441.        END
  5442.  
  5443.  
  5444.  
  5445.      QHIGHBIT -- SUB
  5446.  
  5447.  
  5448.      This  subroutine  will turn off the high order or  leftmost bit of
  5449.      every character in a string.  This may be useful when reading some
  5450.      files  which have been  created by  some word  processing programs
  5451.      such as Wordstar.
  5452.  
  5453.      The format of the call is as follows:
  5454.  
  5455.        QHIGHBIT TstStr$
  5456.  
  5457.      Example:
  5458.  
  5459.        DEFINT A-Z
  5460.        DECLARE SUB QINSTR (TstStr AS STRING)
  5461.        TstStr$="ÇàÄÜ"
  5462.        QHIGHBIT TstStr$
  5463.        PRINT "This string now reads " TstStr$
  5464.        END
  5465.  
  5466.  
  5467.  
  5468.  
  5469.  
  5470.  
  5471.  
  5472.  
  5473.      String                                                              75
  5474.  
  5475.  
  5476.  
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.      QINSTR   -- FUNCTION
  5483.  
  5484.  
  5485.      Returns  the position of  a  character  in  a string based upon  a
  5486.      supplied character which is passed  in the call.  In addition, the
  5487.      desired number of  the character occurence is passed. Returns a -1
  5488.      if an error is encountered or the character is not found.
  5489.  
  5490.      The format of the call is as follows:
  5491.  
  5492.        RC = QINSTR(TstStr$, Delim$, Index)
  5493.  
  5494.      Example:
  5495.  
  5496.        DEFINT A-Z
  5497.        DECLARE FUNCTION QINSTR% (TstStr AS STRING, _
  5498.                                  Delim AS STRING, _
  5499.                                  BYVAL Index AS INTEGER)
  5500.        TstStr$="aaa( ( (  ) ) )aaa"
  5501.        Index = 2
  5502.        Delim$ = "("
  5503.        IF QINSTR(TstStr$, Delim$, Index) = 0 THEN
  5504.           PRINT "The character position is " Index
  5505.        ELSE
  5506.           PRINT "Error in QINSTR Call"
  5507.        END IF
  5508.        END
  5509.  
  5510.  
  5511.  
  5512.      QLEN     -- FUNCTION
  5513.  
  5514.  
  5515.      Returns  the length of a string.  This routine works just like the
  5516.      BASIC LEN() function but is somewhat faster.  This functions works
  5517.      with variable length strings as well as fixed  length strings.  It
  5518.      also works with strings defined with the BASIC TYPE statement.
  5519.  
  5520.      The format of the call is as follows:
  5521.  
  5522.        StrLen = QLEN(TstStr$)
  5523.  
  5524.      Example:
  5525.  
  5526.        DEFINT A-Z
  5527.        DECLARE FUNCTION QLEN% (TstStr AS STRING)
  5528.        TstStr$="1234567890"
  5529.        PRINT "The length of the string is " QLEN(TstStr$)
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.      String                                                              76
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.      QMID     -- FUNCTION
  5549.  
  5550.  
  5551.      Overlays the contents of string 2 with the  contents  of  string 1
  5552.      starting  at  the character  pointed to  by start.  This  function
  5553.      returns a zero if it is successful,  if start if beyond the string
  5554.      2 length or the length of string 1 extends beyond string 2 a -1 is
  5555.      returned.
  5556.  
  5557.      The format of the call is as follows:
  5558.  
  5559.        RC = QMID(Str1$, Str2$, Start)
  5560.  
  5561.      Example:
  5562.  
  5563.        DEFINT A-Z
  5564.        DECLARE FUNCTION QMID% (Str1 AS STRING, _
  5565.                                Str2 AS STRING, _
  5566.                                BYVAL Start AS INTEGER)
  5567.        Str1$ = "zzzzzzzzzz": Str2$ = "aaaXxxxxxxxxxxXaaa"
  5568.        Start = 5
  5569.        XX = QMID(Str1$, Str2$, Start)
  5570.        PRINT Str2$
  5571.        END
  5572.  
  5573.  
  5574.  
  5575.      QMOVREC  -- FUNCTION
  5576.  
  5577.  
  5578.      Move a record defined with the TYPE  function to  a  BASIC  string
  5579.      variable. Currently, only  individule  fields  can  be moved to  a
  5580.      string.
  5581.  
  5582.      The format of the call is as follows:
  5583.  
  5584.        OutString$ = QMOVREC(PtrR, LenR)
  5585.  
  5586.      Example:
  5587.  
  5588.        DEFINT A-Z
  5589.        DECLARE FUNCTION QMOVREC$ (BYVAL PtrR AS INTEGER, _
  5590.                                   BYVAL LenR AS INTEGER)
  5591.        TYPE TestType
  5592.             Fld1 AS STRING * 5
  5593.             Fld2 AS STRING * 10
  5594.        END TYPE
  5595.        DIM TestRec AS TestType
  5596.        TestRec.Fld1 = "AAAAA": TestRec.Fld2 = "0123456789"
  5597.        PtrR = VARPTR(TestRec): LenR = LEN(TestRec)
  5598.        Buffer$ = QMOVREC(PrtR, LenR)
  5599.        PRINT Buffer$
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.      String                                                              77
  5606.  
  5607.  
  5608.  
  5609.  
  5610.  
  5611.  
  5612.  
  5613.  
  5614.      QMOVSTR  -- SUB
  5615.  
  5616.  
  5617.      Moves a BASIC  string variable to a  record defined  with the TYPE
  5618.      function.  Currently,  strings  can only  be moved  to  individule
  5619.      fields.
  5620.  
  5621.      The format of the call is as follows:
  5622.  
  5623.        QMOVSTR PtrR, LenR, OutString$
  5624.  
  5625.      Example:
  5626.  
  5627.        DEFINT A-Z
  5628.        DECLARE SUB QMOVSTR (BYVAL PtrR AS INTEGER, BYVAL LenR AS INTEGER, _
  5629.                             Buffer AS STRING)
  5630.        TYPE TestType
  5631.             Fld1 AS STRING * 5
  5632.             Fld2 AS STRING * 10
  5633.        END TYPE
  5634.        DIM TestRec AS TestType
  5635.        PtrR = VARPTR(TestRec): LenR = LEN(TestRec)
  5636.        Buffer$ = "AAAAA0123456789"
  5637.        QMOVSTR PrtR, LenR, Buffer$
  5638.        PRINT TestRec.Fld1, TestRec.Fld2
  5639.  
  5640.  
  5641.  
  5642.      QREPLACE -- SUB
  5643.  
  5644.  
  5645.      Replace  the  character  specified  by  OLD$  with  the  character
  5646.      specified  by  NEW$.   These  two  characters  must  be  only  one
  5647.      character long or the routine returns without changing the string.
  5648.  
  5649.      The format of the call is as follows:
  5650.  
  5651.        QREPLACE TstStr$, Old$, New$
  5652.  
  5653.      Example:
  5654.  
  5655.        DEFINT A-Z
  5656.        DECLARE SUB QREPLACE (StringName AS STRING, _
  5657.                              OldStr AS STRING, _
  5658.                              NewStr AS STRING)
  5659.        TstStr$="05-29-87"
  5660.        Old$ = "-"
  5661.        New$ = "/"
  5662.        QREPLACE TstStr$, Old$, New$
  5663.        PRINT TstStr$
  5664.  
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.      String                                                              78
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.      QREVERSE -- FUNCTION
  5681.  
  5682.  
  5683.      This  function returns  a  new  string with all characters of  the
  5684.      input string reversed.  In other words, "ABCD" becomes "DCBA".  It
  5685.      is not necessary to supply an output string.
  5686.  
  5687.      The format of the call is as follows:
  5688.  
  5689.        NewStr$ = QREVERSE OldStr$
  5690.  
  5691.      Example:
  5692.  
  5693.        DEFINT A-Z
  5694.        DECLARE FUNCTION QREVERSE$ (StringName AS STRING)
  5695.        TstStr$ = "This is a test string"
  5696.        NewStr$ = QREPLACE TstStr$
  5697.        PRINT NewStr$
  5698.        REM  The results are ==> "gnirts tset a si sihT"
  5699.  
  5700.  
  5701.  
  5702.      QRINSTR  -- FUNCTION
  5703.  
  5704.  
  5705.      This routine is simular to QINSTR except it starts the search from
  5706.      the end of the string and searches towards the beginning.  It will
  5707.      return  the position  of  a  character in  a  string based  upon a
  5708.      supplied character which is  passed in the call.  In addition, the
  5709.      desired number of the character  occurence is passed. Returns a -1
  5710.      if an error is encountered or the character is not found.
  5711.  
  5712.      The format of the call is as follows:
  5713.  
  5714.        RC = QRINSTR(TstStr$, Delim$, Index)
  5715.  
  5716.      Example:
  5717.  
  5718.        DEFINT A-Z
  5719.        DECLARE FUNCTION QRINSTR% (TstStr AS STRING, _
  5720.                                   Delim AS STRING, _
  5721.                                   BYVAL Index AS INTEGER)
  5722.        TstStr$="aaa( ( (  ) ) )aaa"
  5723.        Index = 2
  5724.        Delim$ = ")"
  5725.        IF QRINSTR(TstStr$, Delim$, Index) = 0 THEN
  5726.           PRINT "The character position is " Index
  5727.        ELSE
  5728.           PRINT "Error in QRINSTR Call"
  5729.        END
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.  
  5736.  
  5737.      String                                                              79
  5738.  
  5739.  
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.      QSTRIP   -- FUNCTION
  5747.  
  5748.  
  5749.      This routine removes all occurances  of  blanks  or  spaces from a
  5750.      string and returns a new string.
  5751.  
  5752.      The format of the call is as follows:
  5753.  
  5754.        NewString$ = QSTRIP(StringName$)
  5755.  
  5756.      Example:
  5757.  
  5758.        DEFINT A-Z
  5759.        DECLARE FUNCTION QSTRIP$ (StringName AS STRING)
  5760.        StringName$ = "This is a test string for QSTRIP"
  5761.        NewString$ = QSTRIP(StringName$)
  5762.        PRINT NewString$
  5763.  
  5764.  
  5765.  
  5766.      QSTRPCHR -- FUNCTION
  5767.  
  5768.  
  5769.      This  routine removes all  of  the  occurances  of  the  requested
  5770.      character from a string and return it in a new string.
  5771.  
  5772.      The format of the call is as follows:
  5773.  
  5774.        NewString$ = QSTRPCHR(StringName$, StripChr$)
  5775.  
  5776.      Example:
  5777.  
  5778.        DEFINT A-Z
  5779.        DECLARE FUNCTION QSTRPCHR$ (StringName AS STRING, _
  5780.                                    StripChr AS STRING)
  5781.        StringName$ = "This#is#a#test#string#for#QSTRPCHR"
  5782.        StripChr$ = "#"
  5783.        NewString$ = QSTRPCHR(StringName$, StripChr$)
  5784.        PRINT NewString$
  5785.  
  5786.  
  5787.  
  5788.  
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798.  
  5799.  
  5800.  
  5801.  
  5802.  
  5803.      String                                                              80
  5804.  
  5805.  
  5806.  
  5807.  
  5808.  
  5809.  
  5810.  
  5811.  
  5812.      QSUBSTR  -- FUNCTION
  5813.  
  5814.  
  5815.      This function copies  a portion of  FromStr starting at  the Start
  5816.      position for  Length number of characters and places it in ToStr$.
  5817.      A null string is returned if it was unsuccessful.
  5818.  
  5819.      The format of the call is as follows:
  5820.  
  5821.        ToStr$ = QSUBSTR(FromStr$, Start, Length)
  5822.  
  5823.      Example:
  5824.  
  5825.        DEFINT A-Z
  5826.        DECLARE FUNCTION QSUBSTR$ (FromStr AS STRING, _
  5827.                                   BYVAL Start AS INTEGER, _
  5828.                                   BYVAL Length AS INTEGER)
  5829.         .
  5830.        FromStr$ = "aaaXxxxxxxxxxxXaaa"
  5831.        Start = 4
  5832.        Length = 10
  5833.        ToStr$ = QSUBSTR(FromStr$, Start, Length)
  5834.        PRINT ToStr$
  5835.        END
  5836.  
  5837.  
  5838.  
  5839.      QWORD    -- FUNCTION
  5840.  
  5841.  
  5842.      Returns a string which contains the n'th space delimited word from
  5843.      a string.  Returns a null string if an error is encountered.
  5844.  
  5845.      The format of the call is as follows:
  5846.  
  5847.        Found$ = QWORD(TstStr$, Index)
  5848.  
  5849.      Example:
  5850.  
  5851.        DEFINT A-Z
  5852.        DECLARE FUNCTION QWORD$ (StringName AS STRING, _
  5853.                                 BYVAL Index AS INTEGER)
  5854.        TstStr$="This string contains five words"
  5855.        Index = 4
  5856.        Found$ = QWORD(TstStr$, Index)
  5857.        IF Found$ <> "" THEN
  5858.           PRINT "The fourth word of the string is " Found$
  5859.        ELSE
  5860.           PRINT "Error in QWORD"
  5861.        END
  5862.  
  5863.  
  5864.  
  5865.  
  5866.  
  5867.  
  5868.  
  5869.      String                                                              81
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.      QWORDS   -- FUNCTION
  5879.  
  5880.  
  5881.      Returns the number of space delimited  words  in a string.  If the
  5882.      string is null or all spaces, it will return zero.
  5883.  
  5884.      The format of the call is as follows:
  5885.  
  5886.        Number.Of.Words = QWORDS(TstStr$)
  5887.  
  5888.      Example:
  5889.  
  5890.        DEFINT A-Z
  5891.        DECLARE FUNCTION QWORDS% (StringName AS STRING)
  5892.        TstStr$="This string contains five words"
  5893.        IF QWORDS(TstStr$) > 0 THEN
  5894.           PRINT "The number of words in this string is " QWORDS(TstStr$)
  5895.        ELSE
  5896.           PRINT "Error in QWORDS"
  5897.        END
  5898.  
  5899.  
  5900.  
  5901.  
  5902.  
  5903.  
  5904.  
  5905.  
  5906.  
  5907.  
  5908.  
  5909.  
  5910.  
  5911.  
  5912.  
  5913.  
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922.  
  5923.  
  5924.  
  5925.  
  5926.  
  5927.  
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933.  
  5934.  
  5935.      String                                                              82
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.      SUB-DIRECTORY
  5945.  
  5946.  
  5947.  
  5948.      QCHDIR   -- FUNCTION
  5949.  
  5950.  
  5951.      Change the  current sub-directory. Works the same as the DOS CHDIR
  5952.      command except a return code is set to zero (0) if successful.
  5953.  
  5954.      The format of the call is as follows:
  5955.  
  5956.        RC = QCHDIR(ChFile$)
  5957.  
  5958.      Example:
  5959.  
  5960.        DEFINT A-Z
  5961.        DECLARE FUNCTION QCHDIR% (DirName AS STRING)
  5962.        ChFile$="C:\NEWSUB\DIR"+CHR$(0)
  5963.        IF QCHDIR(ChFile$) = 0 THEN
  5964.           PRINT "New directory set"
  5965.        ELSE
  5966.           PRINT "New directory not selected"
  5967.        END IF
  5968.  
  5969.  
  5970.  
  5971.      QCHKDIR  -- FUNCTION
  5972.  
  5973.  
  5974.      Checks to see  if the requested sub-directory  exists.  The return
  5975.      code is set to -1 if the directory doesn't exist.
  5976.  
  5977.      The format of the call is as follows:
  5978.  
  5979.        RC = QCHKDIR(ChkFile$)
  5980.  
  5981.      Example:
  5982.  
  5983.        DEFINT A-Z
  5984.        DECLARE FUNCTION QCHKDIR% (DirName AS STRING)
  5985.        ChkFile$="C:\CHKSUB\DIR"+CHR$(0)
  5986.        IF QCHKDIR(ChkFile$) = 0 THEN
  5987.           PRINT "Sub-directory exists"
  5988.        ELSE
  5989.           PRINT "The requested sub-directory doesn't exist"
  5990.        END IF
  5991.  
  5992.  
  5993.  
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001.      Sub-Directory                                                       83
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.      QGETDIR  -- FUNCTION
  6011.  
  6012.  
  6013.      Returns  the current sub-directory.  It is no  longer necessary to
  6014.      pre-allocate the return string.
  6015.  
  6016.      The format of the call is as follows:
  6017.  
  6018.        DirStr$ = QGETDIR
  6019.  
  6020.      Example:
  6021.  
  6022.        DEFINT A-Z
  6023.        DECLARE FUNCTION QGETDIR$ ()
  6024.        DirStr$ = QGETDIR
  6025.        PRINT "The current directory is " DirStr$
  6026.  
  6027.  
  6028.  
  6029.      QMKDIR   -- FUNCTION
  6030.  
  6031.  
  6032.      Create  a  new  sub-directory.  Works the same  as the  DOS  MKDIR
  6033.      command except a return code is set to -1  if the directory wasn't
  6034.      created.
  6035.  
  6036.      The format of the call is as follows:
  6037.  
  6038.        RC = QMKDIR(MkFile$)
  6039.  
  6040.      Example:
  6041.  
  6042.        DEFINT A-Z
  6043.        DECLARE FUNCTION QMKDIR% (DirName AS STRING)
  6044.        MkFile$ = "NEWSUBDIR"+CHR$(0)
  6045.        IF QMKDIR(MkFile$) = 0 THEN PRINT "Sub-directory created."
  6046.  
  6047.  
  6048.  
  6049.      QRMDIR   -- FUNCTION
  6050.  
  6051.  
  6052.      Deletes an existing sub-directory.  Same as the  DOS RMDIR command
  6053.      except the RC will be set to -1 if the directory not found.
  6054.  
  6055.      The format of the call is as follows:
  6056.  
  6057.        RC = QRMDIR(RmFile$)
  6058.  
  6059.      Example:
  6060.  
  6061.        DEFINT A-Z
  6062.        DECLARE FUNCTION QRMDIR% (DirName AS STRING)
  6063.        RmFile$ = "OLDSUBDIR"+CHR$(0)
  6064.        IF QRMDIR(RmFile$) = 0 THEN PRINT "Sub-directory deleted."
  6065.  
  6066.  
  6067.      Sub-Directory                                                       84
  6068.  
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.  
  6075.  
  6076.      VIDEO
  6077.  
  6078.  
  6079.  
  6080.      QANSIPRT -- SUB
  6081.  
  6082.  
  6083.      Print a string to the screen including any  ANSI escape characters
  6084.      sequences.   The BASIC LOCATE command must be used before the call
  6085.      to set the line and column before printing. This routine  uses DOS
  6086.      calls so it will print slower than QPRT or QBPRT.
  6087.  
  6088.      The format of the call is as follows:
  6089.  
  6090.        QANSIPRT CharString$
  6091.  
  6092.      Example:
  6093.  
  6094.        DEFINT A-Z
  6095.        DECLARE SUB QANSIPRT (PrtString AS STRING)
  6096.        LOCATE 3,2
  6097.        QANSIPRT CharString$
  6098.  
  6099.  
  6100.  
  6101.      QATTR    -- FUNCTION
  6102.  
  6103.  
  6104.      Calculates the color attribute for routines such as QPRT, QWINDOW,
  6105.      etc. It also allows use of the "blink" attribute.
  6106.  
  6107.      The format of the call is as follows:
  6108.  
  6109.        NAttr = QATTR(Fgrd, Bkgrd)
  6110.  
  6111.      Example:
  6112.  
  6113.        DEFINT A-Z
  6114.        DECLARE FUNCTION QATTR% (BYVAL Fore AS INTEGER, _
  6115.                                 BYVAL Back AS INTEGER)
  6116.        Fgrd = 7 : Bkgrd = 0
  6117.        NAttr = QATTR(Fgrd, Bkgrd)
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.  
  6133.      Video                                                               85
  6134.  
  6135.  
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142.      QBPRT    -- SUB
  6143.  
  6144.  
  6145.      Print a string at the specified location on the screen.  The Color
  6146.      attribute must be computed prior to the call and included with the
  6147.      call.  It also allows the  string  to be printed on  any  of the 4
  6148.      video pages.   This routine uses BIOS calls to print the string so
  6149.      it will be compatible with most versions of DOS.
  6150.  
  6151.      The format of the call is as follows:
  6152.  
  6153.        QBPRT Prt$, Row, Col, NAttr, Page
  6154.  
  6155.      The parameters that are used by QBPRT are as follow:
  6156.  
  6157.      Prt$    The string to be printed.
  6158.      Row     The row to print.
  6159.      Col     The column to print.
  6160.      Attr    The video color attribute to use.
  6161.      Page    The video page to print on.
  6162.  
  6163.      Example:
  6164.  
  6165.        DEFINT A-Z
  6166.        DECLARE SUB QBPRT (PrtLine AS STRING, _
  6167.                           BYVAL Row AS INTEGER, _
  6168.                           BYVAL Col AS INTEGER, _
  6169.                           BYVAL Attr AS INTEGER, _
  6170.                           BYVAL Page AS INTEGER)
  6171.         .
  6172.         .
  6173.        Prt$="This is the string to be printed."
  6174.        Fgrd = 7 : Bkgrd = 0
  6175.        NAttr = QATTR(Fgrd, Bkgrd)
  6176.        Row=5 : Col=10 : Page=0
  6177.        QBPRT Prt$, Row, Col, NAttr, Page
  6178.  
  6179.  
  6180.  
  6181.  
  6182.  
  6183.  
  6184.  
  6185.  
  6186.  
  6187.  
  6188.  
  6189.  
  6190.  
  6191.  
  6192.  
  6193.  
  6194.  
  6195.  
  6196.  
  6197.  
  6198.  
  6199.      Video                                                               86
  6200.  
  6201.  
  6202.  
  6203.  
  6204.  
  6205.  
  6206.  
  6207.  
  6208.      QBMPRT   -- SUB
  6209.  
  6210.  
  6211.      Print a string array at the specified location on the screen.  The
  6212.      color attribute must be calculated before the call and passed with
  6213.      the call.  It also allows the string to be printed on any of the 4
  6214.      video pages.  This routine uses BIOS calls to print the strings so
  6215.      it will be compatible with most versions of DOS.
  6216.  
  6217.      The format of the call is as follows:
  6218.  
  6219.        QBMPRT Elements, VARSEG(Prt$(0)), VARPTR(Prt$(0)), Row, Col, AAttr, Page
  6220.  
  6221.      The parameters that are used by QMPRT are as follows:
  6222.  
  6223.      Elements          The number of occurrences of the array.
  6224.      VARSEG(Prt$(0))   The VARSEG  segment address  of  the first array
  6225.                        element.
  6226.      VARPTR(Prt$(0))   The VARPTR address of the first array element.
  6227.      Row               The row to start printing.
  6228.      Col               The column to start in.
  6229.      Attr              The video color attribute to use.
  6230.      Page              The video page to print on.
  6231.  
  6232.      Example:
  6233.  
  6234.        OPTION BASE 0
  6235.        DEFINT A-Z
  6236.        DECLARE SUB QBMPRT (BYVAL Elements AS INTEGER, _
  6237.                            BYVAL VSeg AS INTEGER, _
  6238.                            BYVAL VOff AS INTEGER, _
  6239.                            BYVAL Row AS INTEGER, _
  6240.                            BYVAL Col AS INTEGER, _
  6241.                            BYVAL Attr AS INTEGER, _
  6242.                            BYVAL Page AS INTEGER)
  6243.        DIM Prt$(4)
  6244.         .
  6245.        Prt$(0)="This is the first string to be printed."
  6246.        Prt$(1)="This is the second string to be printed."
  6247.        Prt$(2)="This is the third string to be printed."
  6248.        Prt$(3)="This is the fourth string to be printed."
  6249.        Fgrd = 1 : Bkgrd = 7
  6250.        AAttr = QATTR(Fgrd, Bkgrd)
  6251.        Row=5 : Col=10 : Page=0
  6252.        Elements=4
  6253.        QBMPRT Elements, VARSEG(Prt$(0)), VARPTR(Prt$(0)), Row, Col, AAttr, Page
  6254.  
  6255.  
  6256.  
  6257.  
  6258.  
  6259.  
  6260.  
  6261.  
  6262.  
  6263.  
  6264.  
  6265.      Video                                                               87
  6266.  
  6267.  
  6268.  
  6269.  
  6270.  
  6271.  
  6272.  
  6273.  
  6274.      QCRTMODE -- SUB
  6275.  
  6276.  
  6277.      This routine will return a  value between 0 and  3 to indicate the
  6278.      type of monitor that is installed.  In addition it will return the
  6279.      current number of  columns that the screen is set too.  Care  must
  6280.      be  taken on some systems such as the AT&T  PC6300 because it will
  6281.      return  a 1 indicationg CGA  even though  a  mono  screen is being
  6282.      used. This is due to  the fact that a CGA video controller card is
  6283.      being used.
  6284.  
  6285.      The format of the call is as follows:
  6286.  
  6287.        QCRTMODE CType, CCols
  6288.  
  6289.      Example:
  6290.  
  6291.        DEFINT A-Z
  6292.        DECLARE SUB QCRTMODE (CrtType AS INTEGER, _
  6293.                              CrtCols AS INTEGER)
  6294.        REM CrtType ==> 0 = MDA, 1 = CGA, 2 = EGA, 3 = VGA
  6295.        QCRTMODE CType, CCols
  6296.        SELECT CASE CType
  6297.               CASE 0
  6298.                    PRINT "Monitor type is MDA with"+STR$(CCols)+" Columns."
  6299.               CASE 1
  6300.                    PRINT "Monitor type is CGA with"+STR$(CCols)+" Columns."
  6301.               CASE 2
  6302.                    PRINT "Monitor type is EGA with"+STR$(CCols)+" Columns."
  6303.               CASE 3
  6304.                    PRINT "Monitor type is VGA with"+STR$(CCols)+" Columns."
  6305.               CASE ELSE
  6306.                    PRINT "Unknown monitor type."
  6307.        END SELECT
  6308.        END
  6309.  
  6310.  
  6311.  
  6312.      QCLREOL  -- SUB
  6313.  
  6314.  
  6315.      This routine will print spaces from the current cursor location to
  6316.      the end  of the line.  The cursor can  be places  anywhere on  the
  6317.      screen using the LOCATE statement.
  6318.  
  6319.      The format of the call is as follows:
  6320.  
  6321.        QCLREOL
  6322.  
  6323.      Example:
  6324.  
  6325.        DEFINT A-Z
  6326.        DECLARE SUB QCLREOL ()
  6327.         .
  6328.        LOCATE 5, 15
  6329.  
  6330.  
  6331.      Video                                                               88
  6332.  
  6333.  
  6334.  
  6335.  
  6336.  
  6337.  
  6338.  
  6339.  
  6340.        QCLREOL
  6341.         .
  6342.        END
  6343.  
  6344.  
  6345.  
  6346.  
  6347.  
  6348.  
  6349.  
  6350.  
  6351.  
  6352.  
  6353.  
  6354.  
  6355.  
  6356.  
  6357.  
  6358.  
  6359.  
  6360.  
  6361.  
  6362.  
  6363.  
  6364.  
  6365.  
  6366.  
  6367.  
  6368.  
  6369.  
  6370.  
  6371.  
  6372.  
  6373.  
  6374.  
  6375.  
  6376.  
  6377.  
  6378.  
  6379.  
  6380.  
  6381.  
  6382.  
  6383.  
  6384.  
  6385.  
  6386.  
  6387.  
  6388.  
  6389.  
  6390.  
  6391.  
  6392.  
  6393.  
  6394.  
  6395.  
  6396.  
  6397.      Video                                                               89
  6398.  
  6399.  
  6400.  
  6401.  
  6402.  
  6403.  
  6404.  
  6405.  
  6406.      QGETATTR -- FUNCTION
  6407.  
  6408.  
  6409.      This function will  return an integer containing the current video
  6410.      attribute at the requested row and column.  This can be useful  in
  6411.      determinine the color attribute being used before print  with QPRT
  6412.      or the other print routines in this library.
  6413.  
  6414.      The format of the call is as follows:
  6415.  
  6416.        Attr = QGETATTR (Row, Col)
  6417.  
  6418.      Example:
  6419.  
  6420.        DEFINT A-Z
  6421.        DECLARE FUNCTION QGETATTR% (BYVAL Row AS INTEGER, _
  6422.                                    BYVAL Col AS INTEGER)
  6423.        PRINT "The color attribute at row 24, column 1 is "; QGETATTR(24,1)
  6424.        END
  6425.  
  6426.  
  6427.  
  6428.      QGETCURS -- SUB
  6429.  
  6430.  
  6431.      This  routine  will return integer values containing  the  current
  6432.      cursor row and column for the requested video page.  This requires
  6433.      only  one  call instead of 2 using  the BASIC funtions  CSRLIN and
  6434.      POS(0).
  6435.  
  6436.      The format of the call is as follows:
  6437.  
  6438.        QGETCURS Row, Col, Page
  6439.  
  6440.      Example:
  6441.  
  6442.        DEFINT A-Z
  6443.        DECLARE SUB QGETCURS (Row AS INTEGER, _
  6444.                              Col AS INTEGER, _
  6445.                              Page AS INTEGER)
  6446.        QGETCURS Row, Col, Page
  6447.        PRINT "The cursor is at Row/Column": Row, Col
  6448.        END
  6449.  
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.      Video                                                               90
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.  
  6470.  
  6471.  
  6472.      QGETMODE -- FUNCTION
  6473.  
  6474.  
  6475.      This  function  will  return an  integer value which  contains the
  6476.      current video mode returned  by the BIOS.  This  value can then be
  6477.      used  to reset  the  video  mode after  it  has  been changed with
  6478.      QSETMODE.
  6479.  
  6480.      The format of the call is as follows:
  6481.  
  6482.        HoldMode = QGETMODE
  6483.  
  6484.      Example:
  6485.  
  6486.        DEFINT A-Z
  6487.        DECLARE FUNCTION QGETMODE% ()
  6488.        HoldMode = QGETMODE
  6489.        QSETMODE HoldMode - 2
  6490.         .
  6491.         .
  6492.        QSETMODE HoldMode
  6493.         .
  6494.        END
  6495.  
  6496.  
  6497.  
  6498.  
  6499.  
  6500.  
  6501.  
  6502.  
  6503.  
  6504.  
  6505.  
  6506.  
  6507.  
  6508.  
  6509.  
  6510.  
  6511.  
  6512.  
  6513.  
  6514.  
  6515.  
  6516.  
  6517.  
  6518.  
  6519.  
  6520.  
  6521.  
  6522.  
  6523.  
  6524.  
  6525.  
  6526.  
  6527.  
  6528.  
  6529.      Video                                                               91
  6530.  
  6531.  
  6532.  
  6533.  
  6534.  
  6535.  
  6536.  
  6537.  
  6538.      QMPRT    -- SUB
  6539.  
  6540.  
  6541.      Print a string array at the specified location on the screen.  The
  6542.      color attribute must be calculated before the call and passed with
  6543.      the call.  It also allows the string to be printed on any of the 4
  6544.      video pages.  This routine  writes  to video ram directly  and may
  6545.      not be compatible with some versions of DOS.
  6546.  
  6547.      The format of the call is as follows:
  6548.  
  6549.        QMPRT Elements, VARSEG(Prt$(0)), VARPTR(Prt$(0)), Row, Col, AAttr, Page
  6550.  
  6551.      The parameters that are used by QMPRT are as follows:
  6552.  
  6553.      Elements          The number of occurrences of the array.
  6554.      VARSEG(Prt$(0))   The VARSEG segment  address of the  first  array
  6555.                        element.
  6556.      VARPTR(Prt$(0))   The VARPTR address of the first array element.
  6557.      Row               The row to start printing.
  6558.      Col               The column to start in.
  6559.      Attr              The video color attribute to use.
  6560.      Page              The video page to print on.
  6561.  
  6562.      Example:
  6563.  
  6564.        OPTION BASE 0
  6565.        DEFINT A-Z
  6566.        DECLARE SUB QMPRT (BYVAL Elements AS INTEGER, _
  6567.                           BYVAL VSeg AS INTEGER, _
  6568.                           BYVAL VOff AS INTEGER, _
  6569.                           BYVAL Row AS INTEGER, _
  6570.                           BYVAL Col AS INTEGER, _
  6571.                           BYVAL Attr AS INTEGER, _
  6572.                           BYVAL Page AS INTEGER)
  6573.        DIM Prt$(4)
  6574.         .
  6575.        Prt$(0)="This is the first string to be printed."
  6576.        Prt$(1)="This is the second string to be printed."
  6577.        Prt$(2)="This is the third string to be printed."
  6578.        Prt$(3)="This is the fourth string to be printed."
  6579.        Fgrd = 1 : Bkgrd = 7
  6580.        AAttr = QATTR(Fgrd, Bkgrd)
  6581.        Row=5 : Col=10 : Page=0
  6582.        Elements=4
  6583.        QMPRT Elements, VARSEG(Prt$(0)), VARPTR(Prt$(0)), Row, Col, AAttr, Page
  6584.  
  6585.  
  6586.  
  6587.  
  6588.  
  6589.  
  6590.  
  6591.  
  6592.  
  6593.  
  6594.  
  6595.      Video                                                               92
  6596.  
  6597.  
  6598.  
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.      QPAINT   -- SUB
  6605.  
  6606.  
  6607.      This subroutine will  change the current foreground and background
  6608.      colors of an area of the screen as defined by  the supplied screen
  6609.      locations.  Any text  that exists in this area will remain.   Only
  6610.      the colors will change.
  6611.  
  6612.      The format of the call is as follows:
  6613.  
  6614.        QPAINT TRow, LCol, BRow, RCol, Attr, Page
  6615.  
  6616.      The parameters that are used by QPAINT are as follows:
  6617.  
  6618.      TR      The top row location.
  6619.      LC      The left column location.
  6620.      BR      The bottom row location.
  6621.      RC      The right column location.
  6622.      Attr    The video color attribute to use.
  6623.      Page    The video page to print on.
  6624.  
  6625.      Example:
  6626.  
  6627.        DEFINT A-Z
  6628.        DECLARE SUB QPAINT (BYVAL TR AS INTEGER, _
  6629.                            BYVAL LC AS INTEGER, _
  6630.                            BYVAL BR AS INTEGER, _
  6631.                            BYVAL RC AS INTEGER, _
  6632.                            BYVAL ATTR AS INTEGER, _
  6633.                            BYVAL PAGE AS INTEGER)
  6634.         .
  6635.         .
  6636.        TRow = 5: LCol = 10: BRow = 15: RCol = 70: Page = 0
  6637.        Attr = QATTR(3, 0)
  6638.        QPAINT TRow, LCol, BRow, RCol, Attr, Page
  6639.         .
  6640.        END
  6641.  
  6642.  
  6643.  
  6644.  
  6645.  
  6646.  
  6647.  
  6648.  
  6649.  
  6650.  
  6651.  
  6652.  
  6653.  
  6654.  
  6655.  
  6656.  
  6657.  
  6658.  
  6659.  
  6660.  
  6661.      Video                                                               93
  6662.  
  6663.  
  6664.  
  6665.  
  6666.  
  6667.  
  6668.  
  6669.  
  6670.      QPRT     -- SUB
  6671.  
  6672.  
  6673.      Print a string at the specified location on the screen.  The color
  6674.      attribute must be calculated prior to the call and passed with the
  6675.      call.   It  also allows the string  to be printed on any  of the 4
  6676.      video pages.   This routine writes to  video  ram directly and may
  6677.      not be compatible with some versions of DOS.
  6678.  
  6679.      The format of the call is as follows:
  6680.  
  6681.        QPRT Prt$, Row, Col, NAttr, Page
  6682.  
  6683.      The parameters that are used by QPRT are as follows:
  6684.  
  6685.      Prt$    The string to be printed.
  6686.      Row     The row to print.
  6687.      Col     The column to print.
  6688.      Attr    The video color attribute to use.
  6689.      Page    The video page to print on.
  6690.  
  6691.      Example:
  6692.  
  6693.        DEFINT A-Z
  6694.        DECLARE SUB QPRT (PrtLine AS STRING, _
  6695.                          BYVAL Row AS INTEGER, _
  6696.                          BYVAL Col AS INTEGER, _
  6697.                          BYVAL Attr AS INTEGER, _
  6698.                          BYVAL Page AS INTEGER)
  6699.         .
  6700.         .
  6701.        Prt$="This is the string to be printed."
  6702.        Fgrd = 7 : Bkgrd = 0
  6703.        NAttr = QATTR(Fgrd, Bkgrd)
  6704.        Row=5 : Col=10 : Page=0
  6705.        QPRT Prt$, Row, Col, NAttr, Page
  6706.  
  6707.  
  6708.  
  6709.  
  6710.  
  6711.  
  6712.  
  6713.  
  6714.  
  6715.  
  6716.  
  6717.  
  6718.  
  6719.  
  6720.  
  6721.  
  6722.  
  6723.  
  6724.  
  6725.  
  6726.  
  6727.      Video                                                               94
  6728.  
  6729.  
  6730.  
  6731.  
  6732.  
  6733.  
  6734.  
  6735.  
  6736.      QPRTANSI -- SUB
  6737.  
  6738.  
  6739.      Print a string to the screen including any ANSI escape  characters
  6740.      sequences.  The unlike the  QANSIPRT sub, this routine has a built
  6741.      in locate function.  In  addition, this subroutine can be passed a
  6742.      number which is the last  line of  a window that the routine  will
  6743.      print  to.  If this number  will be exceeded, the  subroutine will
  6744.      scroll the screen up one before printing the  next  line.  In this
  6745.      case, the  row  and column parameters will be  ignored.   If  this
  6746.      value is  zero, then the  window parameter is ignored and the  row
  6747.      and column specified will  be used. This routine uses DOS calls so
  6748.      it will print slower than QPRT or QBPRT.
  6749.  
  6750.      The format of the call is as follows:
  6751.  
  6752.        QPRTANSI CharString$, Row, Col, Awindow
  6753.  
  6754.      Example:
  6755.  
  6756.        DEFINT A-Z
  6757.        DECLARE SUB QPRTANSI (PrtString AS STRING, _
  6758.                              BYVAL Row AS INTEGER, _
  6759.                              BYVAL Col AS INTEGER, _
  6760.                              BYVAL Awindow AS INTEGER)
  6761.         .
  6762.        REM Print string at row and column specified
  6763.        CharString$ = "This is a string to be printed"
  6764.        Row=5 : Col=10 : Awindow = 0
  6765.        QPRTANSI CharString$, Row, Col, Awindow
  6766.         .
  6767.         .
  6768.        REM Print string at next row if the row is less than the window
  6769.        CharString$ = "This is a string to be printed" + CHR$(13) + CHR$(10)
  6770.        Row=0 : Col=0 : Awindow = 22
  6771.        QPRTANSI CharString$, Row, Col, Awindow
  6772.  
  6773.  
  6774.  
  6775.  
  6776.  
  6777.  
  6778.  
  6779.  
  6780.  
  6781.  
  6782.  
  6783.  
  6784.  
  6785.  
  6786.  
  6787.  
  6788.  
  6789.  
  6790.  
  6791.  
  6792.  
  6793.      Video                                                               95
  6794.  
  6795.  
  6796.  
  6797.  
  6798.  
  6799.  
  6800.  
  6801.  
  6802.      QRESTSCR -- FUNCTION
  6803.  
  6804.  
  6805.      Restore  the portion of  the screen  from an  array that  had been
  6806.      saved with QSAVESCR.  It will restore  the screen to any of  the 4
  6807.      video pages. The screen does  not  have to be restored to the same
  6808.      location that it was saved  from.  The array that is used  must be
  6809.      large enough to hold  the saved screen area.  The way to calculate
  6810.      the size array needed is with the  following ((BottomRow - TopRow)
  6811.      + 1) * (RightCol - LeftCol) + 1).
  6812.  
  6813.      The format of the call is as follows:
  6814.  
  6815.        QRESTSCR TRow, LCol, BRow, RCol, Page, VARSEG(Array(0)), VARPTR(Array(0))
  6816.  
  6817.      The parameters that are used by QRESTSCR are as follows:
  6818.  
  6819.      TR             The top row location.
  6820.      LC             The left column location.
  6821.      BR             The bottom row location.
  6822.      RC             The right column location.
  6823.      Page           The video page to save from.
  6824.      VARSEG(A(0))   The array segment address.
  6825.      VARPTR(A(0))   The array pointer address.
  6826.  
  6827.      Example:
  6828.  
  6829.        DEFINT A-Z
  6830.        DECLARE SUB QRESTSCR (BYVAL TR AS INTEGER, _
  6831.                              BYVAL LC AS INTEGER, _
  6832.                              BYVAL BR AS INTEGER, _
  6833.                              BYVAL RC AS INTEGER, _
  6834.                              BYVAL PAGE AS INTEGER, _
  6835.                              BYVAL VSEG AS INTEGER, _
  6836.                              BYVAL VPTR AS INTEGER)
  6837.        DIM Array(671)
  6838.         .
  6839.        SHELL "DIR"
  6840.        TRow = 5: LCol = 10: BRow = 15: RCol = 70: Page = 0
  6841.        QSAVESCR TRow, LCol, BRow, RCol, Page, VARSEG(Array(0)), VARPTR(Array(0))
  6842.        CLS
  6843.        WHILE INKEY$ = "": WEND
  6844.        QRESTSCR TRow, LCol, BRow, RCol, Page, VARSEG(Array(0)), VARPTR(Array(0))
  6845.        END
  6846.  
  6847.  
  6848.  
  6849.  
  6850.  
  6851.  
  6852.  
  6853.  
  6854.  
  6855.  
  6856.  
  6857.  
  6858.  
  6859.      Video                                                               96
  6860.  
  6861.  
  6862.  
  6863.  
  6864.  
  6865.  
  6866.  
  6867.  
  6868.      QSAVESCR -- FUNCTION
  6869.  
  6870.  
  6871.      Saves a  portion of the screen to an array.   You do  not have  to
  6872.      save the whole  screen, only  the portions  that  is  needed.  The
  6873.      screen can be restored  at a later time using QRESTSCR.  The array
  6874.      that  is used must  be large enough to hold the saved screen area.
  6875.      The way to  calculate the  size array needed is with the following
  6876.      ((BottomRow - TopRow) + 1) * (RightCol - LeftCol) + 1).
  6877.  
  6878.      The format of the call is as follows:
  6879.  
  6880.        QSAVESCR TRow, LCol, BRow, RCol, Page, VARSEG(Array(0)), VARPTR(Array(0))
  6881.  
  6882.      The parameters that are used by QSAVESCR are as follows:
  6883.  
  6884.      TR             The top row location.
  6885.      LC             The left column location.
  6886.      BR             The bottom row location.
  6887.      RC             The right column location.
  6888.      Page           The video page to save from.
  6889.      VARSEG(A(0))   The array segment address.
  6890.      VARPTR(A(0))   The array pointer address.
  6891.  
  6892.      Example:
  6893.  
  6894.        DEFINT A-Z
  6895.        DECLARE SUB QSAVESCR (BYVAL TR AS INTEGER, _
  6896.                              BYVAL LC AS INTEGER, _
  6897.                              BYVAL BR AS INTEGER, _
  6898.                              BYVAL RC AS INTEGER, _
  6899.                              BYVAL PAGE AS INTEGER, _
  6900.                              BYVAL VSEG AS INTEGER, _
  6901.                              BYVAL VPTR AS INTEGER)
  6902.        DIM Array(671)
  6903.         .
  6904.        SHELL "DIR"
  6905.        TRow = 5: LCol = 10: BRow = 15: RCol = 70: Page = 0
  6906.        QSAVESCR TRow, LCol, BRow, RCol, Page, VARSEG(Array(0)), VARPTR(Array(0))
  6907.        CLS
  6908.        WHILE INKEY$ = "": WEND
  6909.        QRESTSCR TRow, LCol, BRow, RCol, Page, VARSEG(Array(0)), VARPTR(Array(0))
  6910.        END
  6911.  
  6912.  
  6913.  
  6914.  
  6915.  
  6916.  
  6917.  
  6918.  
  6919.  
  6920.  
  6921.  
  6922.  
  6923.  
  6924.  
  6925.      Video                                                               97
  6926.  
  6927.  
  6928.  
  6929.  
  6930.  
  6931.  
  6932.  
  6933.  
  6934.      QSCROLL  -- SUB
  6935.  
  6936.  
  6937.      Scrolls the screen up using  the locations that are  passed in the
  6938.      call.  One  or more lines  can be  scrolled and if  the number  is
  6939.      zero, the whole area  will be cleared.  Be sure that  the rows and
  6940.      columns are within the screen.
  6941.  
  6942.      The format of the call is as follows:
  6943.  
  6944.        QSCROLL Trow, Lcol, Brow, Rcol, Lines
  6945.  
  6946.      Example:
  6947.  
  6948.        DEFINT A-Z
  6949.        DECLARE SUB QSCROLL (BYVAL TRow AS INTEGER, _
  6950.                             BYVAL LCol AS INTEGER, _
  6951.                             BYVAL BRow AS INTEGER, _
  6952.                             BYVAL RCol AS INTEGER, _
  6953.                             BYVAL Lines AS INTEGER)
  6954.        Trow = 5 : Lcol = 15 : Brow = 15 : Rcol = 65 : Lines = 2
  6955.        QSCROLL Trow, Lcol, Brow, Rcol, Lines
  6956.         .
  6957.        REM The following will clear an area of the screen
  6958.        Trow = 5 : Lcol = 15 : Brow = 15 : Rcol = 65 : Lines = 0
  6959.        QSCROLL Trow, Lcol, Brow, Rcol, Lines
  6960.  
  6961.  
  6962.  
  6963.      QSCROLLB -- SUB
  6964.  
  6965.  
  6966.      Scrolls the screen down using the locations that are passed in the
  6967.      call.  One or more lines  can be  scrolled  and if  the  number is
  6968.      zero,  the whole area will be cleared.  Be  sure that the rows and
  6969.      columns are within the screen.
  6970.  
  6971.      The format of the call is as follows:
  6972.  
  6973.        QSCROLLB Trow, Lcol, Brow, Rcol, Lines
  6974.  
  6975.      Example:
  6976.  
  6977.        DEFINT A-Z
  6978.        DECLARE SUB QSCROLLB (BYVAL TRow AS INTEGER, _
  6979.                              BYVAL LCol AS INTEGER, _
  6980.                              BYVAL BRow AS INTEGER, _
  6981.                              BYVAL RCol AS INTEGER, _
  6982.                              BYVAL Lines AS INTEGER)
  6983.        Trow = 5 : Lcol = 15 : Brow = 15 : Rcol = 65 : Lines = 2
  6984.        QSCROLLB Trow, Lcol, Brow, Rcol, Lines
  6985.  
  6986.  
  6987.  
  6988.  
  6989.  
  6990.  
  6991.      Video                                                               98
  6992.  
  6993.  
  6994.  
  6995.  
  6996.  
  6997.  
  6998.  
  6999.  
  7000.      QSCRREST -- FUNCTION
  7001.  
  7002.  
  7003.      Restore the  screen  from  an  array  that  had  been  saved  with
  7004.      QSCRSAVE. It  will restore the screen to any of the 4 video pages.
  7005.      If an error was encountered, the RC will be -1.
  7006.  
  7007.      The format of the call is as follows:
  7008.  
  7009.        RC = QSCRREST(VARSEG(ScrnHold(1)), VARPTR(ScrnHold(1)), Page)
  7010.  
  7011.      The parameters that are used by QSCRREST are as follows:
  7012.  
  7013.      VARSEG(Prt$(0))   The  VARSEG  segment address of  the first array
  7014.                        element.
  7015.      VARPTR(Prt$(0))   The VARPTR address of the first array element.
  7016.      Page              The video page to print on.
  7017.  
  7018.      Example:
  7019.  
  7020.        OPTION BASE 1
  7021.        DEFINT A-Z
  7022.        DECLARE FUNCTION QSCRREST% (BYVAL ASeg AS INTEGER, _
  7023.                                    BYVAL AOffset AS INTEGER, _
  7024.                                    BYVAL Page AS INTEGER)
  7025.        DIM ScrnHold(2000)
  7026.        Page = 0
  7027.        IF QSCRREST(VARSEG(ScrnHold(1)), VARPTR(ScrnHold(1)), Page) = 0 THEN
  7028.           LOCATE RowHold,ColHold
  7029.        ELSE
  7030.           PRINT "Error on screen restore"
  7031.        END IF
  7032.  
  7033.  
  7034.  
  7035.  
  7036.  
  7037.  
  7038.  
  7039.  
  7040.  
  7041.  
  7042.  
  7043.  
  7044.  
  7045.  
  7046.  
  7047.  
  7048.  
  7049.  
  7050.  
  7051.  
  7052.  
  7053.  
  7054.  
  7055.  
  7056.  
  7057.      Video                                                               99
  7058.  
  7059.  
  7060.  
  7061.  
  7062.  
  7063.  
  7064.  
  7065.  
  7066.      QSCRSAVE -- FUNCTION
  7067.  
  7068.  
  7069.      Save the  requested  video page  (0 - 3) into array.  Use this  in
  7070.      text mode only.  The array must be an integer array dimensioned to
  7071.      at least 2000 occurrences.  The starting address of the array must
  7072.      be  passed,  use the  VARPTR  function to get  this address.   The
  7073.      cursor location  is  not saved  so,  if  it  is  needed, save  the
  7074.      location.  More than one screen  can be  saved into  the array  as
  7075.      long  as 2000 occurrences are dimensioned for each  screen and the
  7076.      appropriate VARPTR address  is passed the the routine. If an error
  7077.      is encountered, the RC will be -1.
  7078.  
  7079.      The format of the call is as follows:
  7080.  
  7081.        RC = QSCRSAVE(VARSEG(ScrnHold(1)), VARPTR(ScrnHold(1)), Page)
  7082.  
  7083.      The parameters that are used by QSCRSAVE are as follows:
  7084.  
  7085.      VARSEG(Prt$(0))   The VARSEG  segment address  of the  first array
  7086.                        element.
  7087.      VARPTR(Prt$(0))   The VARPTR address of the first array element.
  7088.      Page              The video page to print on.
  7089.  
  7090.      Example:
  7091.  
  7092.        OPTION BASE 1
  7093.        DEFINT A-Z
  7094.        DECLARE FUNCTION QSCRSAVE% (BYVAL ASeg AS INTEGER, _
  7095.                                    BYVAL AOffset AS INTEGER, _
  7096.                                    BYVAL Page AS INTEGER)
  7097.        DIM ScrnHold(2000)
  7098.        Page = 0
  7099.        IF QSCRSAVE(VARSEG(ScrnHold(1)), VARPTR(ScrnHold(1)), Page) = 0 THEN
  7100.           RowHold = CSRLIN
  7101.           ColHold = POS(0)
  7102.        ELSE
  7103.           PRINT "Error on screen save"
  7104.        END IF
  7105.  
  7106.  
  7107.  
  7108.  
  7109.  
  7110.  
  7111.  
  7112.  
  7113.  
  7114.  
  7115.  
  7116.  
  7117.  
  7118.  
  7119.  
  7120.  
  7121.  
  7122.  
  7123.      Video                                                              100
  7124.  
  7125.  
  7126.  
  7127.  
  7128.  
  7129.  
  7130.  
  7131.  
  7132.      QSETMODE -- SUB
  7133.  
  7134.  
  7135.      This subroutine  will  set the video  mode  to  the value  that is
  7136.      supplied. This value can be any of the valid BIOS video modes.
  7137.  
  7138.      The format of the call is as follows:
  7139.  
  7140.        QSETMODE HoldMode
  7141.  
  7142.      Example:
  7143.  
  7144.        DEFINT A-Z
  7145.        DECLARE SUB QSETMODE (BYVAL VMode AS INTEGER)
  7146.        HoldMode = QGETMODE
  7147.        QSETMODE HoldMode - 2
  7148.         .
  7149.         .
  7150.        QSETMODE HoldMode
  7151.         .
  7152.        END
  7153.  
  7154.  
  7155.  
  7156.  
  7157.  
  7158.  
  7159.  
  7160.  
  7161.  
  7162.  
  7163.  
  7164.  
  7165.  
  7166.  
  7167.  
  7168.  
  7169.  
  7170.  
  7171.  
  7172.  
  7173.  
  7174.  
  7175.  
  7176.  
  7177.  
  7178.  
  7179.  
  7180.  
  7181.  
  7182.  
  7183.  
  7184.  
  7185.  
  7186.  
  7187.  
  7188.  
  7189.      Video                                                              101
  7190.  
  7191.  
  7192.  
  7193.  
  7194.  
  7195.  
  7196.  
  7197.  
  7198.      QWINDOW  -- SUB
  7199.  
  7200.  
  7201.      Displays  a  pop-up  window on  the screen.   It  requires several
  7202.      parameters  which are used to determine where  to print the window
  7203.      as well as the type of  frame to be used for the window.  The rows
  7204.      and columns that are used and  the ones that will be used  for the
  7205.      frame. The color attribute that must be computed prior to the call
  7206.      and passed to QWINDOW.  If the  value passed for frame is not 1-4,
  7207.      the screen will be cleared based upon the row and column values.
  7208.  
  7209.      The format of the call is as follows:
  7210.  
  7211.        QWINDOW TRow, LCol, BRow, RCol, Frame, NAttr, Page
  7212.  
  7213.      The parameters that are used by QWINDOW are as follows:
  7214.  
  7215.      TRow    The top row of the window.
  7216.      LCol    The left column of the window.
  7217.      BRow    The bottom row of the window.
  7218.      RCol    The right column of the window.
  7219.      Frame   The type of frame to be used for the window.
  7220.      Attr    The video color attribute to use.
  7221.      Page    The video page to print the window on.
  7222.  
  7223.      The types of frames available with QWINDOW are as follow:
  7224.  
  7225.      1   Single line frame.
  7226.      2   Double line frame.
  7227.      3   Double vertical and single horizontal frame.
  7228.      4   Single vertical and double horizontal frame.
  7229.  
  7230.      Example:
  7231.  
  7232.        DEFINT A-Z
  7233.        DECLARE SUB QWINDOW (BYVAL TRow AS INTEGER, _
  7234.                             BYVAL LCol AS INTEGER, _
  7235.                             BYVAL BRow AS INTEGER, _
  7236.                             BYVAL RCol AS INTEGER, _
  7237.                             BYVAL Frame AS INTEGER, _
  7238.                             BYVAL Attr AS INTEGER, _
  7239.                             BYVAL Page AS INTEGER)
  7240.         .
  7241.        Fgrd=7 : Bkgrd=0
  7242.        NAttr = QATTR(Fgrd, Bkgrd)
  7243.        TRow=1 : LCol=1 : BRow=25 : RCol=80 : Frame=2 : Page=0
  7244.        QWINDOW TRow, LCol, BRow, RCol, Frame, NAttr, Page
  7245.  
  7246.  
  7247.  
  7248.  
  7249.  
  7250.  
  7251.  
  7252.  
  7253.  
  7254.  
  7255.      Video                                                              102
  7256.  
  7257.  
  7258.  
  7259.  
  7260.  
  7261.  
  7262.  
  7263.  
  7264.      QWINDOWH -- SUB
  7265.  
  7266.  
  7267.      Works just like QWINDOW, but in addition, it will draw  horizontal
  7268.      lines across the window based upon the values passed in NLines and
  7269.      RNum.  This routine  can be  very useful in menu  windows.  If the
  7270.      value  passed  in NLines is  zero,  it will  function the same  as
  7271.      QWINDOW. The VARPTR  function must be used to  get the address  of
  7272.      the first array element.
  7273.  
  7274.      To use this routine, you must define a numeric array. Each element
  7275.      of this  array will  contain the row in which  you wish  to have a
  7276.      line drawn across the window.  The address of the first occurrence
  7277.      of the array is what is passed to the routine.
  7278.  
  7279.      The format of the call is as follows:
  7280.  
  7281.        QWINDOWH TRow, LCol, BRow, RCol, NLine, RSeg, RNum, Frame, NAttr, Page
  7282.  
  7283.      The parameters that are used by QWINDOWH are as follows:
  7284.  
  7285.      TRow    The top row of the window.
  7286.      LCol    The left column of the window.
  7287.      BRow    The bottom row of the window.
  7288.      RCol    The right column of the window.
  7289.      NLine   The number of horizontal lines to draw.
  7290.      RSeg    The VARSEG segment address of the first array element.
  7291.      RNum    The VARPTR address of the first array element.
  7292.      Frame   The type of frame to be used for the window.
  7293.      Attr    The video color attribute to use.
  7294.      Page    The video page to print the window on.
  7295.  
  7296.      The types of frames available with QWINDOWH are as follows:
  7297.  
  7298.      1   Single line frame.
  7299.      2   Double line frame.
  7300.      3   Double vertical and single horizontal frame.
  7301.      4   Single vertical and double horizontal frame.
  7302.  
  7303.      Example:
  7304.  
  7305.        OPTION BASE 0
  7306.        DEFINT A-Z
  7307.        DECLARE SUB QWINDOWH (BYVAL TRow AS INTEGER, BYVAL LCol AS INTEGER, _
  7308.                              BYVAL BRow AS INTEGER, BYVAL RCol AS INTEGER, _
  7309.                              BYVAL NLine AS INTEGER, BYVAL ASeg AS INTEGER, _
  7310.                              BYVAL AOff AS INTEGER, BYVAL Frame AS INTEGER, _
  7311.                              BYVAL Attr AS INTEGER, BYVAL Page AS INTEGER)
  7312.        DIM ARow(2)
  7313.         .
  7314.        Fgrd=7 : Bkgrd=0 : NAttr = QATTR(Fgrd, Bkgrd)
  7315.        TRow=1 : LCol=1 : BRow=25 : RCol=80 : Frame=2 : Page=0
  7316.        NLine=2 : ARow(0)=3 : ARow(1)=23
  7317.        RSeg=VARSEG(ARow(0)) : RNum=VARPTR(ARow(0))
  7318.        QWINDOWH TRow, LCol, BRow, RCol, NLine, RSeg, RNum, Frame, NAttr, Page
  7319.  
  7320.  
  7321.      Video                                                              103
  7322.  
  7323.  
  7324.  
  7325.  
  7326.  
  7327.  
  7328.  
  7329.  
  7330.      QWINDOWV -- SUB
  7331.  
  7332.  
  7333.      Works just like  QWINDOW, but in  addition, it will draw  vertical
  7334.      lines down  the window based upon  the values passed in NLines and
  7335.      CNum. If the value passed in NLines is zero, it will  function the
  7336.      same  as QWINDOW.   The  VARPTR  function must  be used to get the
  7337.      address of the first array element.
  7338.  
  7339.      To use this routine, you must define a numeric array. Each element
  7340.      of this  array will contain the row  in which you  wish  to have a
  7341.      line drawn down the window.  The address of  the first  occurrence
  7342.      of the array is what is passed to the routine.
  7343.  
  7344.      The format of the call is as follows:
  7345.  
  7346.        QWINDOWH TRow, LCol, BRow, RCol, NLine, CSeg, CNum, Frame, NAttr, Page
  7347.  
  7348.      The parameters that are used by QWINDOWV are as follows:
  7349.  
  7350.      TRow    The top row of the window.
  7351.      LCol    The left column of the window.
  7352.      BRow    The bottom row of the window.
  7353.      RCol    The right column of the window.
  7354.      NLine   The number of vertical lines to draw.
  7355.      CSeg    The VARSEG segment address of the first array element.
  7356.      CNum    The VARPTR address of the first array element.
  7357.      Frame   The type of frame to be used for the window.
  7358.      Attr    The video color attribute to use.
  7359.      Page    The video page to print the window on.
  7360.  
  7361.      The types of frames available with QWINDOWV are as follows:
  7362.  
  7363.      1   Single line frame.
  7364.      2   Double line frame.
  7365.      3   Double vertical and single horizontal frame.
  7366.      4   Single vertical and double horizontal frame.
  7367.  
  7368.      Example:
  7369.  
  7370.        OPTION BASE 0
  7371.        DEFINT A-Z
  7372.        DECLARE SUB QWINDOWV (BYVAL TRow AS INTEGER, BYVAL LCol AS INTEGER, _
  7373.                              BYVAL BRow AS INTEGER, BYVAL RCol AS INTEGER, _
  7374.                              BYVAL NLine AS INTEGER, BYVAL ASeg AS INTEGER, _
  7375.                              BYVAL AOff AS INTEGER, BYVAL Frame AS INTEGER, _
  7376.                              BYVAL Attr AS INTEGER, BYVAL Page AS INTEGER)
  7377.        DIM ACol(2)
  7378.         .
  7379.        Fgrd=7 : Bkgrd=0 : NAttr = QATTR(Fgrd, Bkgrd)
  7380.        TRow=1 : LCol=1 : BRow=25 : RCol=80 : Frame=2 : Page=0
  7381.        NLine=2 : ACol(0)=5 : ACol(1)=75
  7382.        CSeg=VARSEG(ACol(0)) : CNum=VARPTR(ACol(0))
  7383.        QWINDOWH TRow, LCol, BRow, RCol, NLine, CSeg, CNum, Frame, NAttr, Page
  7384.  
  7385.  
  7386.  
  7387.      Video                                                              104
  7388.  
  7389.  
  7390.  
  7391.  
  7392.  
  7393.  
  7394.  
  7395.  
  7396.      QWINDOWX -- SUB
  7397.  
  7398.  
  7399.      Displays a  pop-up  window  on the screen with  a  user selectable
  7400.      shadow either below left or below rightp window on the  screen. It
  7401.      requires several parameters  which are used to determine  where to
  7402.      print the window as well as the  type of frame to be used  for the
  7403.      window.  The rows and columns that are used and the ones that will
  7404.      be used for the frame. The  color attribute that must  be computed
  7405.      prior to the call and passed to QWINDOWX.  If the value passed for
  7406.      frame is not  1-4, the screen will  be cleared  based upon the row
  7407.      and column values.
  7408.  
  7409.      The format of the call is as follows:
  7410.  
  7411.        QWINDOWX TRow, LCol, BRow, RCol, Frame, NAttr, HAttr, Page
  7412.  
  7413.      The parameters that are used by QWINDOWX are as follows:
  7414.  
  7415.      TRow    The top row of the window.
  7416.      LCol    The left column of the window.
  7417.      BRow    The bottom row of the window.
  7418.      RCol    The right column of the window.
  7419.      Frame   The type of frame to be used for the window.
  7420.      Attr    The video color attribute to use.
  7421.      Page    The video page to print the window on.
  7422.  
  7423.      The types of frames available with QWINDOWX are as follow:
  7424.  
  7425.      1   Single line frame, shadow bottom left.
  7426.      2   Double line frame, shadow bottom left.
  7427.      3   Double  vertical  and single  horizontal  frame, shadow bottom
  7428.          left.
  7429.      4   Single vertical  and double horizontal  frame,  shadow  bottom
  7430.          left.
  7431.      5   Single line frame, shadow bottom right.
  7432.      6   Double line frame, shadow bottom right.
  7433.      7   Double  vertical and single  horizontal  frame, shadow  bottom
  7434.          right.
  7435.      8   Single vertical and  double horizontal  frame,  shadow  bottom
  7436.          right.
  7437.  
  7438.      Example:
  7439.  
  7440.        DEFINT A-Z
  7441.        DECLARE SUB QWINDOWX (BYVAL TRow AS INTEGER, BYVAL LCol AS INTEGER, _
  7442.                              BYVAL BRow AS INTEGER, BYVAL RCol AS INTEGER, _
  7443.                              BYVAL Frame AS INTEGER, BYVAL Attr AS INTEGER, _
  7444.                              BYVAL Attrs AS INTEGER, BYVAL Page AS INTEGER)
  7445.         .
  7446.         REM Will print window with a shadow on bottom left.
  7447.        Fgrd=7 : Bkgrd=0 : NAttr = QATTR(Fgrd, Bkgrd)
  7448.        Fgrd=3 : Bkgrd=2 : HAttr = QATTR(Fgrd, Bkgrd)
  7449.        TRow=5 : LCol=10 : BRow=15 : RCol=30 : Frame=2 : Page=0
  7450.        QWINDOWX TRow, LCol, BRow, RCol, Frame, NAttr, HAttr, Page
  7451.  
  7452.  
  7453.      Video                                                              105
  7454.  
  7455.  
  7456.  
  7457.  
  7458.  
  7459.  
  7460.  
  7461.  
  7462.      QVIDREST -- FUNCTION
  7463.  
  7464.  
  7465.      Restore  a  screen  that  was  saved  with  QVIDSAVE.   Color  and
  7466.      monochrome screens have  4 pages of video  memory and this routine
  7467.      will  move  a screen  from pages 1-3  to page  0.  If  an error is
  7468.      encountered, the RC will be set to -1.
  7469.  
  7470.      The format of the call is as follows:
  7471.  
  7472.        RC = QVIDREST(Page)
  7473.  
  7474.      Example:
  7475.  
  7476.        DEFINT A-Z
  7477.        DECLARE FUNCTION QVIDREST% (BYVAL Page AS INTEGER)
  7478.        Page = 2
  7479.        RC = QVIDREST(Page)
  7480.  
  7481.  
  7482.  
  7483.      QVIDSAVE -- FUNCTION
  7484.  
  7485.  
  7486.      Save a screen to video page 1, 2 or 3 from page 0.  If an error is
  7487.      encountered, the RC will be set to -1.
  7488.  
  7489.      The format of the call is as follows:
  7490.  
  7491.        RC = QVIDSAVE(Page)
  7492.  
  7493.      Example:
  7494.  
  7495.        DEFINT A-Z
  7496.        DECLARE FUNCTION QVIDSAVE% (BYVAL Page AS INTEGER)
  7497.        Page = 2
  7498.        RC = QVIDSAVE(Page)
  7499.  
  7500.  
  7501.  
  7502.  
  7503.  
  7504.  
  7505.  
  7506.  
  7507.  
  7508.  
  7509.  
  7510.  
  7511.  
  7512.  
  7513.  
  7514.  
  7515.  
  7516.  
  7517.  
  7518.  
  7519.      Video                                                              106
  7520.  
  7521.  
  7522.  
  7523.  
  7524.  
  7525.